Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -479,9 +479,6 @@ tests:
- class: org.elasticsearch.xpack.ml.integration.AutodetectMemoryLimitIT
method: testTooManyByAndOverFields
issue: https://github.com/elastic/elasticsearch/issues/132310
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
method: testBadAsyncId
issue: https://github.com/elastic/elasticsearch/issues/132353
- class: org.elasticsearch.xpack.esql.inference.completion.CompletionOperatorTests
method: testSimpleCircuitBreaking
issue: https://github.com/elastic/elasticsearch/issues/132382
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public EsqlExecutionInfo(StreamInput in) throws IOException {
public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalTimeValue(overallTook);
if (clusterInfo != null) {
out.writeCollection(clusterInfo.values());
// .stream().toList() creates an immutable copy of the cluster info entries
// as today they might be still changing while serialization is happening
out.writeCollection(clusterInfo.values().stream().toList());
Copy link
Contributor

Choose a reason for hiding this comment

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

I am pretty sure this will fix it, but I am not entirely happy about this because the only place where this is needed is when we're initializing the cluster list, which is a very brief moment in the life of the query, but we're paying for it with having to copy this structure every time, even though most of the time it's not needed. I wonder if there's a better way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly. Lets merge this fix to address the issue and I will take a look if we could avoid underlying concurrent modification as part of another change.

} else {
out.writeCollection(Collections.emptyList());
}
Expand Down