Commit ae15e1d
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 685cb59 commit ae15e1d
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 | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
540 | | - | |
| 540 | + | |
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
200 | 202 | | |
201 | 203 | | |
202 | 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 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
203 | 256 | | |
204 | 257 | | |
205 | 258 | | |
| |||
0 commit comments