Skip to content

Commit

Permalink
Fix Expected Exception Check in BlobstoreCacheService (elastic#63474) (
Browse files Browse the repository at this point in the history
…elastic#64134)

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 elastic#63233
  • Loading branch information
original-brownbear authored Oct 26, 2020
1 parent bbb515d commit c435246
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,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 c435246

Please sign in to comment.