Skip to content

fix(brpc): Skip backup when retry budget is exhausted - #3688

Open
darion-yaphet wants to merge 1 commit into
apache:masterfrom
darion-yaphet:fix/backup-timeout-without-retry-budget
Open

darion-yaphet wants to merge 1 commit into
apache:masterfrom
darion-yaphet:fix/backup-timeout-without-retry-budget

Conversation

@darion-yaphet

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: Related to #3275

Problem Summary:

When max_retry=0, or earlier retries have exhausted the budget, the backup timer can terminate an in-flight RPC with EBACKUPREQUEST before its overall timeout.

For example, an RPC configured with a 10ms timeout and a 2ms backup threshold may fail at approximately 2ms even though the original request could still succeed.

What is changed and the side effects?

Changed:

  • Skip the backup request when no retry budget remains, while keeping the current request in flight.
  • Restore the original overall deadline before returning from the backup event handler.
  • Add regression coverage for zero and exhausted retry budgets, naming-service and direct channels, synchronous and asynchronous calls, and finite and infinite timeouts.
  • Document the behavior in both client guides.

Side effects:

  • Performance effects: No additional request is sent when the retry budget is exhausted. Performance benchmarks were not run.
  • Breaking backward compatibility: No public API or ABI changes. Calls that previously failed prematurely now wait for completion or the overall timeout.

Check List:

  • Built brpc_channel_unittest successfully.
  • Passed all 89 tests in brpc_channel_unittest on macOS.
  • Verified the new regression test fails before the fix and passes afterward across 24 configuration combinations.
  • Updated the Chinese and English client guides.
  • Please follow Contributor Covenant Code of Conduct.

Keep the in-flight RPC alive when the backup timer fires without remaining retry budget. Restore the original overall deadline instead of terminating with EBACKUPREQUEST.

Cover zero and exhausted retry budgets across naming-service and direct channels, synchronous and asynchronous calls, and finite and infinite timeouts. Document the behavior in both client guides.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant