diff options
author | kulikov <kulikov@yandex-team.com> | 2023-07-27 12:28:50 +0300 |
---|---|---|
committer | kulikov <kulikov@yandex-team.com> | 2023-07-27 12:28:50 +0300 |
commit | 4a7691c519e6114e013dc1dd0c3b2528154507f9 (patch) | |
tree | af6ee3a210f95bb4532036b1f1a5352ef072068a /library/cpp/http | |
parent | dcde92436ae71c3fdf1d6b9916e3858f3b35146e (diff) | |
download | ydb-4a7691c519e6114e013dc1dd0c3b2528154507f9.tar.gz |
revert rXXXXXX (see discusstion in pr), will commit again more pci-dss friendly way
Diffstat (limited to 'library/cpp/http')
-rw-r--r-- | library/cpp/http/server/http.cpp | 30 | ||||
-rw-r--r-- | library/cpp/http/server/options.h | 6 |
2 files changed, 10 insertions, 26 deletions
diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index ecdd93ab56e..2dd407dceff 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -2,7 +2,6 @@ #include "http_ex.h" #include <library/cpp/threading/equeue/equeue.h> -#include <library/cpp/threading/equeue/fast.h> #include <util/generic/buffer.h> #include <util/generic/intrlist.h> @@ -406,8 +405,8 @@ public: : TImpl( parent, cb, - MakeThreadPool<TSimpleThreadPool>(factory, options, cb, options.RequestsThreadName), - MakeThreadPool<TThreadPool>(factory, options, nullptr, options.FailRequestsThreadName), + MakeThreadPool<TSimpleThreadPool>(factory, options.UseElasticQueues, cb, options.RequestsThreadName), + MakeThreadPool<TThreadPool>(factory, options.UseElasticQueues, nullptr, options.FailRequestsThreadName), options) { } @@ -457,30 +456,21 @@ public: private: template <class TThreadPool_> - static THolder<IThreadPool> MakeThreadPool(ICallBack* callback, const IThreadPool::TParams& params) { - if (callback) { - return MakeHolder<TThreadPoolBinder<TThreadPool_, THttpServer::ICallBack>>(callback, params); - } else { - return MakeHolder<TThreadPool_>(params); - } - } - - template <class TThreadPool_> - static THolder<IThreadPool> MakeThreadPool(IThreadFactory* factory, const TOptions& options, ICallBack* callback = nullptr, const TString& threadName = {}) { + static THolder<IThreadPool> MakeThreadPool(IThreadFactory* factory, bool elastic, ICallBack* callback = nullptr, const TString& threadName = {}) { if (!factory) { factory = SystemThreadFactory(); } THolder<IThreadPool> pool; const auto params = IThreadPool::TParams().SetFactory(factory).SetThreadName(threadName); - - if (options.UseFastElasticQueues) { - pool = MakeThreadPool<TFastElasticQueue>(callback, params); + if (callback) { + pool = MakeHolder<TThreadPoolBinder<TThreadPool_, THttpServer::ICallBack>>(callback, params); } else { - pool = MakeThreadPool<TThreadPool_>(callback, params); - if (options.UseElasticQueues) { - pool = MakeHolder<TElasticQueue>(std::move(pool)); - } + pool = MakeHolder<TThreadPool_>(params); + } + + if (elastic) { + pool = MakeHolder<TElasticQueue>(std::move(pool)); } return pool; diff --git a/library/cpp/http/server/options.h b/library/cpp/http/server/options.h index 4656dd7082e..5976d58f32f 100644 --- a/library/cpp/http/server/options.h +++ b/library/cpp/http/server/options.h @@ -131,11 +131,6 @@ public: return *this; } - inline THttpServerOptions& EnableFastElasticQueues(bool enable) noexcept { - UseFastElasticQueues = enable; - - return *this; - } inline THttpServerOptions& SetThreadsName(const TString& listenThreadName, const TString& requestsThreadName, const TString& failRequestsThreadName) noexcept { ListenThreadName = listenThreadName; RequestsThreadName = requestsThreadName; @@ -172,7 +167,6 @@ public: ui64 MaxInputContentLength = sizeof(size_t) <= 4 ? 2_GB : 64_GB; size_t MaxRequestsPerConnection = 0; // If keep-alive is enabled, request limit before connection is closed bool UseElasticQueues = false; - bool UseFastElasticQueues = false; TDuration PollTimeout; // timeout of TSocketPoller::WaitT call TDuration ExpirationTimeout; // drop inactive connections after ExpirationTimeout (should be > 0) |