Skip to content

Conversation

@ivancea
Copy link
Contributor

@ivancea ivancea commented May 21, 2025

Manual 9.0 backport of #128211

…ing the test factories list (elastic#128211)

Fixes elastic#128092

The error happens inside an ArrayList.add(), and it's a concurrency-related one.

The stacktrace is quite explicative:
```
java.lang.ArrayIndexOutOfBoundsException: Index 34 out of bounds for length 33
at java.util.ArrayList.add(ArrayList.java:485)
at org.elasticsearch.compute.test.ComputeTestCase.blockFactory(ComputeTestCase.java:62)
at org.elasticsearch.compute.aggregation.GroupingAggregatorFunctionTestCase$4$1$1.addBlock(GroupingAggregatorFunctionTestCase.java:659)
```

We were creating new blockFactories() inside the aggregator, which was being called concurrently with different drivers. As `blockFactory()` adds it to a static ArrayList, it was sometimes throwing.

The bug only affects tests. Potentially, all grouping aggregators tests.
@ivancea ivancea added >test Issues or PRs that are addressing/adding tests backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Analytics/ES|QL AKA ESQL v9.0.2 labels May 21, 2025
@ivancea ivancea changed the title ESQL: Unmute test and reuse blockFactory to avoid concurrently modifying the test factories list (#128211) [9.0] ESQL: Unmute test and reuse blockFactory to avoid concurrently modifying the test factories list (#128211) May 21, 2025
@ivancea ivancea removed the v9.0.2 label May 21, 2025
@elasticsearchmachine elasticsearchmachine merged commit 0b793ca into elastic:9.0 May 21, 2025
16 checks passed
@ivancea ivancea deleted the backport-9.0-esql-unmute-array-index-percentile-test branch May 21, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v9.0.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants