[server] Make pending queue timeout configurable (#35459)

Help out with b/314162143

Closes #35459

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35459 from ctiller:config-timeout daa00917bc
PiperOrigin-RevId: 596019307
pull/35464/head
Craig Tiller 1 year ago committed by Copybara-Service
parent fede9051e1
commit c112dd7054
  1. 6
      include/grpc/impl/channel_arg_names.h
  2. 6
      src/core/lib/surface/server.cc
  3. 2
      src/core/lib/surface/server.h

@ -106,6 +106,12 @@
*/
#define GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS \
"grpc.http2.min_ping_interval_without_data_ms"
/** Maximum time to allow a request to be:
(1) received by the server, but
(2) not requested by a RequestCall (in the completion queue based API)
before the request is cancelled */
#define GRPC_ARG_SERVER_MAX_UNREQUESTED_TIME_IN_SERVER_SECONDS \
"grpc.server_max_unrequested_time_in_server"
/** Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
/** How many pings can the client send before needing to send a

@ -829,7 +829,11 @@ RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
Server::Server(const ChannelArgs& args)
: channel_args_(args),
channelz_node_(CreateChannelzNode(args)),
server_call_tracer_factory_(ServerCallTracerFactory::Get(args)) {}
server_call_tracer_factory_(ServerCallTracerFactory::Get(args)),
max_time_in_pending_queue_(Duration::Seconds(
channel_args_
.GetInt(GRPC_ARG_SERVER_MAX_UNREQUESTED_TIME_IN_SERVER_SECONDS)
.value_or(30))) {}
Server::~Server() {
// Remove the cq pollsets from the config_fetcher.

@ -489,7 +489,7 @@ class Server : public InternallyRefCounted<Server>,
0,
channel_args_.GetInt(GRPC_ARG_SERVER_MAX_PENDING_REQUESTS_HARD_LIMIT)
.value_or(3000)))};
Duration max_time_in_pending_queue_{Duration::Seconds(30)};
const Duration max_time_in_pending_queue_;
absl::BitGen bitgen_ ABSL_GUARDED_BY(mu_call_);
std::list<ChannelData*> channels_;

Loading…
Cancel
Save