-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Fix Driver creating status with a live list of operators #132260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESQL: Fix Driver creating status with a live list of operators #132260
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Hi @ivancea, I've created a changelog YAML for you. |
prev.iterations() + extraIterations, | ||
status, | ||
statusOfCompletedOperators, | ||
new ArrayList<>(statusOfCompletedOperators), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably do List.copyOf
here, but this is fine.
I think it's worth a comment that we always update the statusOfCompletedOperators
list in this thread, but we read it in many threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the suggestion, and a test.
About the statusOfCompletedOperators
, after this change, it's never read outside of the updateStatus()
💔 Backport failed
You can use sqren/backport to manually backport by running |
…ic#132260) `DriverStatus` is an immutable record created by the Driver. However, its components are not inherently immutable. This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to `ConcurrentModificationException`s when reading it (Through the Task list API, for example). Some example errors: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:134) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` And: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.documentsFound(DriverStatus.java:157) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:129) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at org.elasticsearch.server@9.2.0org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` Also, this looks like the source of this issue, with another similar case: Fixes elastic#131564
Enjoy! |
…ic#132260) `DriverStatus` is an immutable record created by the Driver. However, its components are not inherently immutable. This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to `ConcurrentModificationException`s when reading it (Through the Task list API, for example). Some example errors: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:134) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` And: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.documentsFound(DriverStatus.java:157) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:129) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at org.elasticsearch.server@9.2.0org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` Also, this looks like the source of this issue, with another similar case: Fixes elastic#131564
…ic#132260) `DriverStatus` is an immutable record created by the Driver. However, its components are not inherently immutable. This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to `ConcurrentModificationException`s when reading it (Through the Task list API, for example). Some example errors: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:134) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` And: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.documentsFound(DriverStatus.java:157) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:129) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at org.elasticsearch.server@9.2.0org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` Also, this looks like the source of this issue, with another similar case: Fixes elastic#131564
…ic#132260) `DriverStatus` is an immutable record created by the Driver. However, its components are not inherently immutable. This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to `ConcurrentModificationException`s when reading it (Through the Task list API, for example). Some example errors: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:134) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` And: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.documentsFound(DriverStatus.java:157) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:129) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at org.elasticsearch.server@9.2.0org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` Also, this looks like the source of this issue, with another similar case: Fixes elastic#131564
…ic#132260) `DriverStatus` is an immutable record created by the Driver. However, its components are not inherently immutable. This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to `ConcurrentModificationException`s when reading it (Through the Task list API, for example). Some example errors: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:134) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` And: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.documentsFound(DriverStatus.java:157) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:129) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at org.elasticsearch.server@9.2.0org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` Also, this looks like the source of this issue, with another similar case: Fixes elastic#131564
…) (#132333) `DriverStatus` is an immutable record created by the Driver. However, its components are not inherently immutable. This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to `ConcurrentModificationException`s when reading it (Through the Task list API, for example). Some example errors: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:134) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` And: ``` java.util.ConcurrentModificationException at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1096) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1050) at org.elasticsearch.compute.operator.DriverStatus.documentsFound(DriverStatus.java:157) at org.elasticsearch.compute.operator.DriverStatus.toXContent(DriverStatus.java:129) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.value(XContentBuilder.java:993) at [email protected]/org.elasticsearch.xcontent.XContentBuilder.field(XContentBuilder.java:978) at [email protected]/org.elasticsearch.tasks.TaskInfo.toXContent(TaskInfo.java:113) at org.elasticsearch.server@9.2.0org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:63) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup.toXContent(TaskGroup.java:67) at [email protected]/org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse.lambda$groupedByParent$10(ListTasksResponse.java:183) ``` Also, this looks like the source of this issue, with another similar case: Fixes #131564
DriverStatus
is an immutable record created by the Driver. However, its components are not inherently immutable.This PR fixes a live collection used by the Driver, that was being directly put into the status, leading to
ConcurrentModificationException
s when reading it (Through the Task list API, for example).Some example errors:
And:
Also, this looks like the source of this issue, with another similar case:
Fixes #131564