[C++] max_age_filter

43 views
Skip to first unread message

Arpit Baldeva

unread,
Aug 11, 2017, 6:31:42 PM8/11/17
to grpc.io
Hi,

The server side gRFC - https://github.com/ejona86/proposal/blob/a339b01be9eafffb1adc4db8c782469caed18bdc/A9-server-side-conn-mgt.md - does not mention that both connection age and connection idle need to be specified together. So shouldn't the following code use an || instead of &&?

static bool maybe_add_max_age_filter(grpc_exec_ctx* exec_ctx,
                                     grpc_channel_stack_builder* builder,
                                     void* arg) 
bool enable =
      grpc_channel_arg_get_integer(
          grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS),
          MAX_CONNECTION_AGE_INTEGER_OPTIONS) != INT_MAX &&
      grpc_channel_arg_get_integer(
          grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS),
          MAX_CONNECTION_IDLE_INTEGER_OPTIONS) != INT_MAX;

I can see use of setting one without the other.

Thanks. 

Vijay Pai

unread,
Sep 12, 2017, 7:17:33 PM9/12/17
to grpc.io
Yes, I think you're right. There could certainly be cases where you would use IDLE without caring about AGE.

Yuchen Zeng

unread,
Sep 12, 2017, 7:28:53 PM9/12/17
to grpc.io
I've sent out https://github.com/grpc/grpc/pull/12523 to fix it. Thanks for filing this issue!
Reply all
Reply to author
Forward
0 new messages