Skip to content

Commit

Permalink
xds: Fix XDS control plane client retry timer backoff duration when c…
Browse files Browse the repository at this point in the history
…onnection closes after results are received (#11766)

* Fix retry timer backoff duration.

* Reset stopwatch when we had results on AdsStream rather than change the delay calculation logic.
  • Loading branch information
larry-safran authored Dec 19, 2024
1 parent 7601afc commit ef7c2d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
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();
}

// 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

0 comments on commit ef7c2d5

Please sign in to comment.