grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

retry maxAttempts limited to 5

Open kaedwen opened this issue 2 years ago • 4 comments

Problem description

We need to configure a retry maxAttempts limit of 10 in our scenario. Why is there a max limit of 5 hardcoded 2 months ago? If the client is configured with maxAttempts: 100 and there are resource issues then this is up to the user to handle this.

https://github.com/grpc/grpc-node/commit/fa21e13ef38dd7cbc44fd1156fd97169c876025e

Additional context

Maybe I do not understand the root cause and if you have a good explanation why it would help a lot.

kaedwen avatar Jan 17 '23 09:01 kaedwen

The limit of 5 is in the spec, explained here. The spec does say that the limit can be configured on the client, but this library's implementation is based on the C core implementation, which does not have those configuration options.

I'll treat this as a feature request to add those options.

murgatroid99 avatar Jan 17 '23 19:01 murgatroid99

Ok there is a proposal which says that there is a client side max of 5. But it can be adjusted in the channel settings. Where do I have to provide these settings?

The C core impl is the underdaying client core right? If I patch out the max restriction in your js impl the core is retrying more than 5 times. So I do not understand why to restrict than in js.

If the C core would be implemented correctly and could be configured via channel arguments to support more than 5 times, then I would accept the highlevel restriction. But how should this be possible when the js impl would stop after max 5 attempts but the C core is configured to do more. It won't get any further requests then?

kaedwen avatar Jan 18 '23 09:01 kaedwen

What I'm saying here is that the channel argument to adjust the client side maximum number of retries is not implemented, and that I will treat this issue as a feature request to add that functionality.

The JS library is not based on the core in the sense that it uses the core, but in the sense that the design and implementation are derived from earlier work in the core library.

murgatroid99 avatar Jan 18 '23 17:01 murgatroid99

Thanks for creating this issue @kaedwen. This change broke our app which is trying to reconnect an infinite number of times. I would be glad if the decision could be reconsidered.

Greetings!

E: I just tested our app with version 1.8.8 instead of 1.8.9 and it started working again. Take my comment with a grain of salt, it might be another issue.

Oliver-Piorun avatar Feb 18 '23 23:02 Oliver-Piorun

Version 1.11.0 now has an option grpc-node.retry_max_attempts_limit to configure this behavior.

murgatroid99 avatar Jul 15 '24 21:07 murgatroid99