mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
generic_server: use named gate
Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -115,6 +115,7 @@ connection::connection(server& server, connected_socket&& fd, named_semaphore& s
|
||||
, _fd{std::move(fd)}
|
||||
, _read_buf(data_source(std::make_unique<counted_data_source_impl>(_fd.input().detach(), _conns_cpu_concurrency)))
|
||||
, _write_buf(output_stream<char>(data_sink(std::make_unique<counted_data_sink_impl>(_fd.output().detach(), _conns_cpu_concurrency)), 8192, output_stream_options{.batch_flushes = true}))
|
||||
, _pending_requests_gate("generic_server::connection")
|
||||
, _hold_server(_server._gate)
|
||||
{
|
||||
++_server._total_connections;
|
||||
@@ -251,6 +252,7 @@ config::config(uint32_t uninitialized_connections_semaphore_cpu_concurrency)
|
||||
server::server(const sstring& server_name, logging::logger& logger, config cfg)
|
||||
: _server_name{server_name}
|
||||
, _logger{logger}
|
||||
, _gate("generic_server::server")
|
||||
, _conns_cpu_concurrency(cfg.uninitialized_connections_semaphore_cpu_concurrency)
|
||||
, _prev_conns_cpu_concurrency(_conns_cpu_concurrency)
|
||||
, _conns_cpu_concurrency_semaphore(_conns_cpu_concurrency, named_semaphore_exception_factory{"connections cpu concurrency semaphore"})
|
||||
|
||||
@@ -57,7 +57,7 @@ protected:
|
||||
input_stream<char> _read_buf;
|
||||
output_stream<char> _write_buf;
|
||||
future<> _ready_to_respond = make_ready_future<>();
|
||||
seastar::gate _pending_requests_gate;
|
||||
seastar::named_gate _pending_requests_gate;
|
||||
seastar::gate::holder _hold_server;
|
||||
|
||||
private:
|
||||
@@ -107,7 +107,7 @@ class server {
|
||||
protected:
|
||||
sstring _server_name;
|
||||
logging::logger& _logger;
|
||||
seastar::gate _gate;
|
||||
seastar::named_gate _gate;
|
||||
future<> _all_connections_stopped = make_ready_future<>();
|
||||
uint64_t _total_connections = 0;
|
||||
uint64_t _shed_connections = 0;
|
||||
|
||||
Reference in New Issue
Block a user