Commit 8dc697a
authored
`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
1 parent 043ddc3 commit 8dc697a
File tree
3 files changed
+50
-1
lines changed- docs/changelog
- x-pack/plugin/esql/compute/src
- main/java/org/elasticsearch/compute/operator
- test/java/org/elasticsearch/compute/operator
3 files changed
+50
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
207 | 250 | | |
208 | 251 | | |
209 | 252 | | |
| |||
0 commit comments