Commit b53bd53 1 parent 297802d commit b53bd53 Copy full SHA for b53bd53
File tree 1 file changed +7
-1
lines changed
google-cloud-storage/src/main/java/com/google/cloud/storage
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 25
25
import com .google .api .gax .rpc .ServerStreamingCallable ;
26
26
import com .google .api .gax .rpc .StateCheckingResponseObserver ;
27
27
import com .google .api .gax .rpc .StreamController ;
28
+ import com .google .api .gax .rpc .WatchdogTimeoutException ;
28
29
import com .google .cloud .BaseServiceException ;
29
30
import com .google .cloud .storage .Conversions .Decoder ;
30
31
import com .google .cloud .storage .Crc32cValue .Crc32cLengthKnown ;
@@ -93,7 +94,12 @@ final class GapicUnbufferedReadableByteChannel
93
94
@ Override
94
95
public boolean shouldRetry (
95
96
Throwable previousThrowable , java .lang .Object previousResponse ) {
96
- boolean shouldRetry = alg .shouldRetry (previousThrowable , null );
97
+ // unfortunately we can't unit test this as this time, because WatchdogTimeoutException
98
+ // does not have a publicly accessible way of constructing it.
99
+ boolean isWatchdogTimeout =
100
+ previousThrowable instanceof StorageException
101
+ && previousThrowable .getCause () instanceof WatchdogTimeoutException ;
102
+ boolean shouldRetry = isWatchdogTimeout || alg .shouldRetry (previousThrowable , null );
97
103
if (previousThrowable != null && !shouldRetry ) {
98
104
result .setException (previousThrowable );
99
105
}
You can’t perform that action at this time.
0 commit comments