Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 5, 2024
1 parent a3e24ed commit daa0091
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions include/grpc/impl/channel_arg_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/core/lib/surface/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/surface/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit daa0091

Please sign in to comment.