Skip to content

Commit

Permalink
Fix Expected Exception Check in BlobstoreCacheService (#63474)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
original-brownbear authored Oct 13, 2020
1 parent 1dea28a commit 1a1d26e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,13 @@ public void onFailure(Exception e) {
}

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) {
Expand Down

0 comments on commit 1a1d26e

Please sign in to comment.