From 7b4de401d25af49cb7b567877272994c3b6370f5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 19 Sep 2020 23:22:14 +0900 Subject: [PATCH] nghttpx: Check worker wide blocker before creating new downstream connection --- src/shrpx_client_handler.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index c4b0be59..3668c17a 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -985,6 +985,14 @@ ClientHandler::get_downstream_connection(int &err, Downstream *downstream) { return dconn; } + if (worker_->get_connect_blocker()->blocked()) { + if (LOG_ENABLED(INFO)) { + DCLOG(INFO, this) + << "Worker wide backend connection was blocked temporarily"; + } + return nullptr; + } + if (LOG_ENABLED(INFO)) { CLOG(INFO, this) << "Downstream connection pool is empty." << " Create new one";