Skip to content

Conversation

@ivancea
Copy link
Contributor

@ivancea ivancea commented May 20, 2025

Fixes #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.

If it happened after a recent change, i don't know. It doesn't look like it to me; that code is some months old. But I changed the caller chain, so maybe there are other mutes somewhere that I couldn't find

@ivancea ivancea requested review from idegtiarenko and nik9000 May 20, 2025 16:55
@ivancea ivancea added >test Issues or PRs that are addressing/adding tests Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL v8.19.0 v9.1.0 v9.0.2 labels May 20, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ivan!

@ivancea ivancea enabled auto-merge (squash) May 21, 2025 10:38
@ivancea ivancea merged commit fb3149c into elastic:main May 21, 2025
17 of 18 checks passed
@ivancea ivancea deleted the esql-unmute-array-index-percentile-test branch May 21, 2025 11:45
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 128211

ivancea added a commit to ivancea/elasticsearch that referenced this pull request May 21, 2025
…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 added a commit to ivancea/elasticsearch that referenced this pull request May 21, 2025
…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.
elasticsearchmachine pushed a commit that referenced this pull request May 21, 2025
…ing the test factories list (#128211) (#128243)

Fixes #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.
elasticsearchmachine pushed a commit that referenced this pull request May 21, 2025
…ing the test factories list (#128211) (#128242)

Fixes #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.
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-backport Automatically create backport pull requests when merged Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.19.0 v9.0.3 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] PercentileIntGroupingAggregatorFunctionTests testManyInitialManyPartialFinalRunner failing

3 participants