Skip to content

xds: Fix XDS control plane client retry timer backoff duration when connection closes after results are received #11766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ private void handleRpcStreamClosed(Status status) {
// Reset the backoff sequence if had received a response, or backoff sequence
// has never been initialized.
retryBackoffPolicy = backoffPolicyProvider.get();
stopwatch.reset();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Quick question for my understanding, StopWatch itself is not a thread-safe class and requires external synchronization, but in the control plane client it is thread safe because we run it in the synchronization context?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. We rely heavily on synchronization context.

}

// FakeClock in tests isn't thread-safe. Schedule the retry timer before notifying callbacks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3524,6 +3524,7 @@ public void streamClosedAndRetryWithBackoff() {
call.verifyRequest(EDS, EDS_RESOURCE, "", "", NODE);

// Management server closes the RPC stream with an error.
fakeClock.forwardNanos(1000L); // Make sure retry isn't based on stopwatch 0
call.sendError(Status.UNKNOWN.asException());
verify(ldsResourceWatcher, Mockito.timeout(1000).times(1))
.onError(errorCaptor.capture());
Expand Down
Loading