in grpc-gcp/src/main/java/com/google/cloud/grpc/GcpManagedChannel.java [1709:1727]
private void detectUnresponsiveConnection(
long startNanos, Status status, boolean fromClientSide) {
if (status.getCode().equals(Code.DEADLINE_EXCEEDED)) {
if (startNanos < lastResponseNanos) {
// Skip deadline exceeded from past calls.
return;
}
if (deadlineExceededCount.incrementAndGet() >= unresponsiveDropCount
&& msSinceLastResponse() >= unresponsiveMs) {
maybeReconnectUnresponsive();
}
return;
}
if (!fromClientSide) {
// If not a deadline exceeded and not coming from the client side then reset time and count.
lastResponseNanos = System.nanoTime();
deadlineExceededCount.set(0);
}
}