Commit b7ba699
committed
ESQL: Fix Driver creating status with a live list of operators (elastic#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#1315641 parent 7c6d6db commit b7ba699
File tree
3 files changed
+62
-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
+62
-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 | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
Lines changed: 55 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 | | |
| |||
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
255 | 310 | | |
256 | 311 | | |
257 | 312 | | |
| |||
0 commit comments