core: add 50 hop limit to rpc forwarding #16577
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If I add an infinite loop due to client RPCs as in #16517, I now get a hideous error message like this in 21ms:
I think this is probably a good failsafe, although making the error friendlier would be nice.
I should be able to test it by adding a custom broken handler to a Server.
I think the maximum number of hops if everything goes well is 3 as HTTP->RPC isn't counted, and Client RPCs mostly aren't counted (although could be? 🤔)
That being said requests across leadership elections may get forwarded more than once, and I'd hate to set this so low it unexpectedly broke some future feature. 50 hops in 21ms (locally).