Fix Expected Exception Check in BlobstoreCacheService (#63474) (#64135)

The `NodeNotConnectedException` exception can be nested as well in the
fairly unlikley case of the disconnect occuring between the connected check
and actually sending the request in the transport service.

Closes #63233
This commit is contained in:
Armin Braun 2020-10-26 10:43:29 +01:00 committed by GitHub
parent 17843a40ef
commit 8161513cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -251,10 +251,13 @@ public class BlobStoreCacheService {
}
private static boolean isExpectedCacheGetException(Exception e) {
return TransportActions.isShardNotAvailableException(e)
if (TransportActions.isShardNotAvailableException(e)
|| e instanceof ConnectTransportException
|| e instanceof ClusterBlockException
|| ExceptionsHelper.unwrapCause(e) instanceof NodeClosedException;
|| e instanceof ClusterBlockException) {
return true;
}
final Throwable cause = ExceptionsHelper.unwrapCause(e);
return cause instanceof NodeClosedException || cause instanceof ConnectTransportException;
}
public void putAsync(String repository, String name, String path, long offset, BytesReference content, ActionListener<Void> listener) {