xds: Fix XDS control plane client retry timer backoff duration when connection 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.
This commit is contained in:
Larry Safran 2024-12-19 14:46:58 -08:00 committed by GitHub
parent 7601afc213
commit ef7c2d59c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -446,6 +446,7 @@ final class ControlPlaneClient {
// 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

View File

@ -3524,6 +3524,7 @@ public abstract class GrpcXdsClientImplTestBase {
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());