Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,6 @@ tests:
- class: org.elasticsearch.action.admin.cluster.state.TransportClusterStateActionTests
method: testGetClusterStateWithDefaultProjectOnly
issue: https://github.com/elastic/elasticsearch/issues/134450
- class: org.elasticsearch.cluster.ClusterInfoServiceIT
method: testMaxQueueLatenciesInClusterInfo
issue: https://github.com/elastic/elasticsearch/issues/134500
- class: org.elasticsearch.xpack.esql.expression.function.scalar.score.DecayTests
method: "testEvaluateBlockWithNulls {TestCase=<date_nanos>, <date_nanos>, <time_duration>, <_source> #11}"
issue: https://github.com/elastic/elasticsearch/issues/134509
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ public void testMaxQueueLatenciesInClusterInfo() throws Exception {
threadsToJoin[i].join();
}
Arrays.stream(threadsToJoin).forEach(thread -> assertFalse(thread.isAlive()));
// Monitor the write executor on the data node to try and determine when the backlog of tasks
// has been fully drained (and
// {@link org.elasticsearch.common.util.concurrent.TaskExecutionTimeTrackingEsThreadPoolExecutor.afterExecute()}
// has been called). This is probably not foolproof, so worth investigating if we see non-zero utilization numbers
// after the next poll. See https://github.com/elastic/elasticsearch/issues/134500
assertBusy(() -> assertThat(trackingWriteExecutor.getActiveCount(), equalTo(0)));
Copy link
Contributor Author

@nicktindall nicktindall Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this could still have a very rare race condition where we get a zero inbetween the tasks being executed, but given that the write pool defaults to # of cores, it seems unlikely we'd go to 0 active, then to non-zero again as we drain the queue.

I'm not sure if there's a more satisfying approach to knowing when the work is all done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add this as a comment and then link the existing test failure in case the test fails again in X weeks for the reason mentioned above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 2ec6995


assertThat(
"Unexpectedly found a task queued for the write thread pool. Write thread pool dump: " + trackingWriteExecutor,
Expand Down