mirror of https://github.com/grpc/grpc-java.git
Change delay for hedging retry after a non-fatal error to be 0 to match the gRFC A6. (#10293)
Fixes #10145
This commit is contained in:
parent
31321562ee
commit
f1de820c19
|
|
@ -1067,6 +1067,10 @@ abstract class RetriableStream<ReqT> implements ClientStream {
|
||||||
isThrottled = !throttle.onQualifiedFailureThenCheckIsAboveThreshold();
|
isThrottled = !throttle.onQualifiedFailureThenCheckIsAboveThreshold();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isFatal && !isThrottled && !status.isOk()
|
||||||
|
&& (pushbackMillis != null && pushbackMillis > 0)) {
|
||||||
|
pushbackMillis = 0; // We want the retry after a nonfatal error to be immediate
|
||||||
|
}
|
||||||
return new HedgingPlan(!isFatal && !isThrottled, pushbackMillis);
|
return new HedgingPlan(!isFatal && !isThrottled, pushbackMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2518,7 +2518,7 @@ public class RetriableStreamTest {
|
||||||
Status.fromCode(NON_FATAL_STATUS_CODE_1), PROCESSED, headers);
|
Status.fromCode(NON_FATAL_STATUS_CODE_1), PROCESSED, headers);
|
||||||
|
|
||||||
fakeClock.forwardTime(HEDGING_DELAY_IN_SECONDS, TimeUnit.SECONDS);
|
fakeClock.forwardTime(HEDGING_DELAY_IN_SECONDS, TimeUnit.SECONDS);
|
||||||
inOrder.verifyNoMoreInteractions();
|
inOrder.verify(retriableStreamRecorder).newSubstream(anyInt());
|
||||||
|
|
||||||
fakeClock.forwardTime(1, TimeUnit.SECONDS);
|
fakeClock.forwardTime(1, TimeUnit.SECONDS);
|
||||||
assertEquals(1, fakeClock.numPendingTasks());
|
assertEquals(1, fakeClock.numPendingTasks());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue