Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

core: updates the backoff range as per the A6 redefinition#11858

Merged
larry-safran merged 5 commits intomasterfrom
updates-retry-behavior-for-redefinition-in-A6
Feb 5, 2025
Merged

core: updates the backoff range as per the A6 redefinition#11858
larry-safran merged 5 commits intomasterfrom
updates-retry-behavior-for-redefinition-in-A6

Conversation

Copy link
Contributor

AgraVator commented Jan 28, 2025

Fixes: #11700
Updates the backoff range from [0, 1] to [0.8, 1.2] as per the A6 redefinition

AgraVator assigned AgraVator and unassigned AgraVator Jan 28, 2025
AgraVator requested review from ejona86, kannanjgithub, larry-safran and shivaspeaks January 29, 2025 06:16
shivaspeaks reviewed Jan 30, 2025
// Calculate the exponential backoff delay with jitter
double exponent = retryCount > 0 ? Math.pow(BACKOFF_MULTIPLIER, retryCount) : 1;
long delay = (long) (INITIAL_BACKOFF_IN_SECONDS * exponent);
return RetriableStream.intervalWithJitter(delay);
Copy link
Member

shivaspeaks Jan 30, 2025 *
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not testing when isExperimentalRetryJitterEnabled is toggled.

Copy link
Contributor Author

AgraVator Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, had discussed it with @kannanjgithub, we can add it if it is absolutely needed, but the default behavior is covered and the other one is to be deprecated after a few releases.
P.S. I think you meant the testing is not covered for "false" or the old behavior.

shivaspeaks reacted with thumbs up emoji
Copy link
Contributor

larry-safran Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it is pretty trivial to see that setting the flag to false couldn't cause any problems, so it is fine to skip testing that case.

If it wasn't so obvious, but still simple, you'd want to create a single test case where you:

  1. saved the flag's System.property value (could be null)
  2. set it to the non-default value (in this case "false")
  3. Do the test logic
  4. restore the System.property (for null do an unset)
    Then when the flag is removed the test case can be deleted (would want to add a TODO on the test case indicating that it should be removed that includes the flag name).

If it was something complicated that affected a lot of behavior then you would want to parameterize the test so that all (or at least most) of the test cases would run both ways. You can do a search for @RunWith(Parameterized.class) to see a number of examples in our existing tests. Note that to skip specific tests with some options you can use org.junit.Assume

AgraVator reacted with thumbs up emoji
shivaspeaks reviewed Jan 30, 2025
// Calculate the exponential backoff delay with jitter
double exponent = retryCount > 0 ? Math.pow(BACKOFF_MULTIPLIER, retryCount) : 1;
long delay = (long) (INITIAL_BACKOFF_IN_SECONDS * exponent);
return RetriableStream.intervalWithJitter(delay);
Copy link
Contributor

larry-safran Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it is pretty trivial to see that setting the flag to false couldn't cause any problems, so it is fine to skip testing that case.

If it wasn't so obvious, but still simple, you'd want to create a single test case where you:

  1. saved the flag's System.property value (could be null)
  2. set it to the non-default value (in this case "false")
  3. Do the test logic
  4. restore the System.property (for null do an unset)
    Then when the flag is removed the test case can be deleted (would want to add a TODO on the test case indicating that it should be removed that includes the flag name).

If it was something complicated that affected a lot of behavior then you would want to parameterize the test so that all (or at least most) of the test cases would run both ways. You can do a search for @RunWith(Parameterized.class) to see a number of examples in our existing tests. Note that to skip specific tests with some options you can use org.junit.Assume

AgraVator reacted with thumbs up emoji
ejona86 and others added 3 commits February 5, 2025 14:19
This is the only usage of PickSubchannelArgs when creating a filter's
ClientInterceptor, and a follow-up commit will remove the argument and
actually reuse the interceptors. Other filter's interceptors can
already be reused.

There doesn't seem to be any significant loss of legibility by making
FaultFilter a more ordinary interceptor, but the change does cause the
ForwardingClientCall to be present when faultDelay is configured,
independent of whether the fault delay ends up being triggered.

Reusing interceptors will move more state management out of the RPC path
which will be more relevant with RLQS.
* netty: Removed 4096 min buffer size
shivaspeaks approved these changes Feb 5, 2025
Copy link
Member

shivaspeaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait for Eric's review. @ejona86

larry-safran approved these changes Feb 5, 2025
larry-safran merged commit 44e92e2 into master Feb 5, 2025
18 checks passed
ejona86 deleted the updates-retry-behavior-for-redefinition-in-A6 branch February 12, 2025 22:24
github-actions bot locked as resolved and limited conversation to collaborators May 14, 2025
github-actions bot locked as resolved and limited conversation to collaborators May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

shivaspeaks shivaspeaks approved these changes

ejona86 Awaiting requested review from ejona86

kannanjgithub Awaiting requested review from kannanjgithub

+1 more reviewer

larry-safran larry-safran approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

core: Update retry behavior for redefinition in A6

5 participants