Skip to content

Commit 054fda0

Browse files
Move catch (InterruptedException e) in ThreadPoolMergeExecutorService
1 parent 0b55e35 commit 054fda0

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

server/src/main/java/org/elasticsearch/index/engine/ThreadPoolMergeExecutorService.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,19 @@ private boolean enqueueMergeTaskExecution() {
130130
try {
131131
// will block if there are backlogged merges until they're enqueued again
132132
smallestMergeTask = queuedMergeTasks.take();
133-
// let the task's scheduler decide if it can actually run the merge task now
134-
if (smallestMergeTask.runNowOrBacklog()) {
135-
runMergeTask(smallestMergeTask);
136-
break;
137-
}
138-
smallestMergeTask = null;
139-
// the merge task is backlogged by the merge scheduler, try to get the next smallest one
140-
// it's then the duty of the said merge scheduler to re-enqueue the backlogged merge task when it can be run
141133
} catch (InterruptedException e) {
142134
interrupted = true;
143135
// this runnable must always run exactly a single merge task
136+
continue;
144137
}
138+
// let the task's scheduler decide if it can actually run the merge task now
139+
if (smallestMergeTask.runNowOrBacklog()) {
140+
runMergeTask(smallestMergeTask);
141+
break;
142+
}
143+
smallestMergeTask = null;
144+
// the merge task is backlogged by the merge scheduler, try to get the next smallest one
145+
// it's then the duty of the said merge scheduler to re-enqueue the backlogged merge task when it can be run
145146
}
146147
} finally {
147148
if (smallestMergeTask != null && smallestMergeTask.supportsIOThrottling()) {

0 commit comments

Comments
 (0)