[RECOVERY] Fix potential NPE status reference must be not null to fail recovery
This commit is contained in:
parent
687705364d
commit
275ae2d4da
|
@ -462,7 +462,7 @@ public class RecoveryTarget extends AbstractComponent {
|
|||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
try (RecoveriesCollection.StatusRef statusRef = onGoingRecoveries.getStatus(recoveryId)) {
|
||||
if (statusRef == null) {
|
||||
if (statusRef != null) {
|
||||
logger.error("unexpected error during recovery [{}], failing shard", t, recoveryId);
|
||||
onGoingRecoveries.failRecovery(recoveryId,
|
||||
new RecoveryFailedException(statusRef.status().state(), "unexpected error", t),
|
||||
|
|
Loading…
Reference in New Issue