/** * {@inheritDoc} * * <p>Ensures retries are only scheduled if the {@link StreamResumptionStrategy} in the {@code * ServerStreamingAttemptCallable} supports it. */ @Override public boolean shouldRetry( Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings nextAttemptSettings) throws CancellationException { // Unwrap if (prevThrowable instanceof ServerStreamingAttemptException) { ServerStreamingAttemptException attemptExceptino = (ServerStreamingAttemptException) prevThrowable; prevThrowable = prevThrowable.getCause(); if (!attemptExceptino.canResume()) { return false; } } return super.shouldRetry(prevThrowable, prevResponse, nextAttemptSettings); } }
/** * {@inheritDoc} * * <p>Ensures retries are only scheduled if the {@link StreamResumptionStrategy} in the {@code * ServerStreamingAttemptCallable} supports it. */ @Override public boolean shouldRetry( Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings nextAttemptSettings) throws CancellationException { // Unwrap if (prevThrowable instanceof ServerStreamingAttemptException) { ServerStreamingAttemptException attemptExceptino = (ServerStreamingAttemptException) prevThrowable; prevThrowable = prevThrowable.getCause(); if (!attemptExceptino.canResume()) { return false; } } return super.shouldRetry(prevThrowable, prevResponse, nextAttemptSettings); } }
boolean shouldRetry = retryAlgorithm.shouldRetry(throwable, response, nextAttemptSettings); if (shouldRetry) { tracer.attemptFailed(throwable, nextAttemptSettings.getRandomizedRetryDelay());
boolean shouldRetry = retryAlgorithm.shouldRetry(throwable, response, nextAttemptSettings); if (shouldRetry) { tracer.attemptFailed(throwable, nextAttemptSettings.getRandomizedRetryDelay());