mirror of https://github.com/grpc/grpc-java.git
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:
parent
7601afc213
commit
ef7c2d59c1
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue