diff --git a/src/replica/config/ConfigTestData.cc b/src/replica/config/ConfigTestData.cc index cdf6ead25..886617a15 100644 --- a/src/replica/config/ConfigTestData.cc +++ b/src/replica/config/ConfigTestData.cc @@ -55,6 +55,7 @@ map> ConfigTestData::parameters() { "async-loader-auto-resume", "async-loader-cleanup-on-resume", "http-max-listen-conn", + "http-max-queued-requests", "svc-port", "fs-port", "data-dir", @@ -124,6 +125,7 @@ json ConfigTestData::data() { {"async-loader-auto-resume", 0}, {"async-loader-cleanup-on-resume", 0}, {"http-max-listen-conn", 512}, + {"http-max-queued-requests", 1024}, {"svc-port", 51000}, {"fs-port", 52000}, {"data-dir", "/data"}, diff --git a/src/replica/config/ConfigurationSchema.cc b/src/replica/config/ConfigurationSchema.cc index 07c4f5238..41b8fbdac 100644 --- a/src/replica/config/ConfigurationSchema.cc +++ b/src/replica/config/ConfigurationSchema.cc @@ -352,6 +352,14 @@ json const ConfigurationSchema::_schemaJson = json::object( "The maximum length of the queue of pending connections sent to the Replication worker's" " HTTP-based ingest service. Must be greater than 0."}, {"default", max_listen_connections}}}, + {"http-max-queued-requests", + {{"description", + "The maximum number of pending requests, i.e. requests accept()ed by" + " the listener but still waiting to be routed by the HTTP server." + " If set to 0 then no specific limit will be enforced. It's recommented to keep" + " the default value unless there are specific reasons to change it."}, + {"empty-allowed", 1}, + {"default", 0}}}, {"svc-port", {{"description", "The port number for the worker's replication service."}, {"default", 25000}}}, {"fs-port", diff --git a/src/replica/tests/testConfiguration.cc b/src/replica/tests/testConfiguration.cc index f599d1bd5..8e1190525 100644 --- a/src/replica/tests/testConfiguration.cc +++ b/src/replica/tests/testConfiguration.cc @@ -170,6 +170,7 @@ BOOST_AUTO_TEST_CASE(ConfigurationTestReadingGeneralParameters) { BOOST_CHECK(config->get("worker", "async-loader-auto-resume") == 0); BOOST_CHECK(config->get("worker", "async-loader-cleanup-on-resume") == 0); BOOST_CHECK(config->get("worker", "http-max-listen-conn") == 512); + BOOST_CHECK(config->get("worker", "http-max-queued-requests") == 1024); BOOST_CHECK(config->get("worker", "loader-max-warnings") == 2); BOOST_CHECK(config->get("worker", "ingest-charset-name") == "latin1"); BOOST_CHECK(config->get("worker", "ingest-num-retries") == 1); @@ -375,6 +376,12 @@ BOOST_AUTO_TEST_CASE(ConfigurationTestModifyingGeneralParameters) { BOOST_REQUIRE_NO_THROW(config->set("worker", "http-max-listen-conn", 2048)); BOOST_CHECK(config->get("worker", "http-max-listen-conn") == 2048); + BOOST_CHECK(config->get("worker", "http-max-queued-requests") == 1024); + BOOST_REQUIRE_NO_THROW(config->set("worker", "http-max-queued-requests", 2048)); + BOOST_CHECK(config->get("worker", "http-max-queued-requests") == 2048); + BOOST_REQUIRE_NO_THROW(config->set("worker", "http-max-queued-requests", 0)); + BOOST_CHECK(config->get("worker", "http-max-queued-requests") == 0); + BOOST_CHECK_THROW(config->set("worker", "loader-max-warnings", 0), std::invalid_argument); BOOST_REQUIRE_NO_THROW(config->set("worker", "loader-max-warnings", 100)); BOOST_CHECK(config->get("worker", "loader-max-warnings") == 100);