Skip to content

Conversation

@noCharger
Copy link
Collaborator

@noCharger noCharger commented Oct 8, 2025

Description

Remove shared mutable optimizer field that caused race condition. This field was shared across all concurrent queries that using same Analyzer singleton. For example,

    this.optimizer = optimizer;

Query A sets to optimizerA and Query B overwrite it, causing Query A to use Query B's optimizer with wrong LogicalPlan mappings.

This resulted in "can't evaluate on aggregator" exception

throw new ExpressionEvaluationException(
String.format("can't evaluate on aggregator: %s", functionName));
}

Check List

  • New functionality includes testing.
  • New functionality has been documented. N/A
  • New functionality has javadoc added.
  • New functionality has a user manual doc added. N/A
  • New PPL command checklist all confirmed. N/A
  • API changes companion pull request created. N/A
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created. N/A

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Louis Chu <lingzhichu.clz@gmail.com>
@noCharger noCharger added the bug Something isn't working label Oct 8, 2025
Signed-off-by: Louis Chu <lingzhichu.clz@gmail.com>
Signed-off-by: Louis Chu <lingzhichu.clz@gmail.com>
@noCharger noCharger changed the title Resolve concurrency issue Remove shared mutable optimizer field that caused race condition Oct 8, 2025
@noCharger noCharger marked this pull request as ready for review October 8, 2025 15:09
Signed-off-by: Louis Chu <lingzhichu.clz@gmail.com>
Signed-off-by: Louis Chu <lingzhichu.clz@gmail.com>
Swiddis
Swiddis previously approved these changes Oct 8, 2025
@Swiddis Swiddis merged commit 93aef3f into opensearch-project:main Oct 8, 2025
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants