bail out of recovery when close and still waiting on throttling
This commit is contained in:
parent
a05c367c5e
commit
acae0650c8
|
@ -150,6 +150,10 @@ public class IndexShardGatewayService extends AbstractIndexShardComponent implem
|
||||||
|
|
||||||
// we know we are on a thread, we can spin till we can engage in recovery
|
// we know we are on a thread, we can spin till we can engage in recovery
|
||||||
while (!recoveryThrottler.tryRecovery(shardId, "gateway")) {
|
while (!recoveryThrottler.tryRecovery(shardId, "gateway")) {
|
||||||
|
if (indexShard.ignoreRecoveryAttempt()) {
|
||||||
|
listener.onIgnoreRecovery("ignoring recovery while waiting on retry");
|
||||||
|
return;
|
||||||
|
}
|
||||||
recoveryStatus.updateStage(RecoveryStatus.Stage.RETRY);
|
recoveryStatus.updateStage(RecoveryStatus.Stage.RETRY);
|
||||||
try {
|
try {
|
||||||
Thread.sleep(recoveryThrottler.throttleInterval().millis());
|
Thread.sleep(recoveryThrottler.throttleInterval().millis());
|
||||||
|
@ -157,9 +161,10 @@ public class IndexShardGatewayService extends AbstractIndexShardComponent implem
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
if (indexShard.ignoreRecoveryAttempt()) {
|
if (indexShard.ignoreRecoveryAttempt()) {
|
||||||
listener.onIgnoreRecovery("Interrupted while waiting for recovery, but we should ignore ...");
|
listener.onIgnoreRecovery("Interrupted while waiting for recovery, but we should ignore ...");
|
||||||
return;
|
} else {
|
||||||
|
listener.onRecoveryFailed(new IndexShardGatewayRecoveryException(shardId, "Interrupted while waiting to recovery", e));
|
||||||
}
|
}
|
||||||
listener.onRecoveryFailed(new IndexShardGatewayRecoveryException(shardId, "Interrupted while waiting to recovery", e));
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue