Skip to content

Commit 3c8a231

Browse files
committed
Abort pending deletion on IndicesService close
When IndicesService is closed, the pending deletion may still be in progress due to indices removed before IndicesService gets closed. If the deletion stucks for some reason, it can stall the node shutdown. This PR aborts the pending deletion more promptly by not retry after IndicesService is closed. Resolves: #121717, #121716, #122119
1 parent 3e3dfa4 commit 3c8a231

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/indices/IndicesService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ public void processPendingDeletes(Index index, IndexSettings indexSettings, Time
14401440
sleepTime = Math.min(maxSleepTimeMs, sleepTime * 2); // increase the sleep time gradually
14411441
logger.debug("{} schedule pending delete retry after {} ms", index, sleepTime);
14421442
}
1443-
} while ((System.nanoTime() - startTimeNS) < timeout.nanos());
1443+
} while ((System.nanoTime() - startTimeNS) < timeout.nanos() && lifecycle.closed() == false);
14441444
}
14451445
} finally {
14461446
IOUtils.close(shardLocks);

0 commit comments

Comments
 (0)