Skip to content

Commit 203eb47

Browse files
Remove redundant synchronized block from QueryPhaseResultConsumer (#116282)
It's in the title, we already hold that mutex here.
1 parent f88f68d commit 203eb47

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

server/src/main/java/org/elasticsearch/action/search/QueryPhaseResultConsumer.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,13 @@ private synchronized void onMergeFailure(Exception exc) {
434434
}
435435

436436
private void tryExecuteNext() {
437+
assert Thread.holdsLock(this);
437438
final MergeTask task;
438-
synchronized (this) {
439-
if (hasFailure() || runningTask.get() != null) {
440-
return;
441-
}
442-
task = queue.poll();
443-
runningTask.set(task);
439+
if (hasFailure() || runningTask.get() != null) {
440+
return;
444441
}
442+
task = queue.poll();
443+
runningTask.set(task);
445444
if (task == null) {
446445
return;
447446
}

0 commit comments

Comments
 (0)