Commit f5c7a7e
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 202aa92 commit f5c7a7e
File tree
3 files changed
+60
-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
+60
-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 | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 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 | + | |
191 | 244 | | |
192 | 245 | | |
193 | 246 | | |
| |||
0 commit comments