Skip to content

Conversation

@andrross
Copy link
Member

A behavior change in JDK-25 means that ClassValue.getFromHashMap will now wrap any checked exceptions with java.lang.Error. The fix is to wrap checked exceptions in ClassValue.computeValue with a specific RuntimeException wrapper, and then unwrap it later when handling.

Related Issues

Prereq for #19698

Check List

  • Functionality includes testing.

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.

@github-actions
Copy link
Contributor

❌ Gradle check result for eacd530: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@andrross andrross force-pushed the painless-wrap-exceptions branch from eacd530 to acbf138 Compare October 21, 2025 18:34
@github-actions
Copy link
Contributor

❌ Gradle check result for acbf138: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@andrross
Copy link
Member Author

Waiting on #19703

A behavior change in [JDK-25][1] means that ClassValue.getFromHashMap
will now wrap any checked exceptions with `java.lang.Error`. The fix is
to wrap checked exceptions in `ClassValue.computeValue` with a specific
RuntimeException wrapper, and then unwrap it later when handling.

[1]: https://bugs.openjdk.org/browse/JDK-8351996

Signed-off-by: Andrew Ross <[email protected]>
@github-actions
Copy link
Contributor

❌ Gradle check result for cb1790c: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

✅ Gradle check result for cb1790c: SUCCESS

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.12%. Comparing base (0316a02) to head (2f96c88).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ain/java/org/opensearch/painless/DefBootstrap.java 60.00% 1 Missing and 1 partial ⚠️
...n/java/org/opensearch/painless/PainlessScript.java 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19706      +/-   ##
============================================
- Coverage     73.16%   73.12%   -0.05%     
+ Complexity    70842    70801      -41     
============================================
  Files          5732     5732              
  Lines        324191   324200       +9     
  Branches      46922    46923       +1     
============================================
- Hits         237186   237060     -126     
- Misses        67841    68014     +173     
+ Partials      19164    19126      -38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

❌ Gradle check result for 2f96c88: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

✅ Gradle check result for 2f96c88: SUCCESS

@andrross andrross merged commit 8feb6e1 into opensearch-project:main Oct 22, 2025
34 of 36 checks passed
@andrross andrross deleted the painless-wrap-exceptions branch October 22, 2025 15:51
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.19 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.19 2.19
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.19
# Create a new branch
git switch --create backport/backport-19706-to-2.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8feb6e14ffbcf75c10eb8f90158fa27299a7b14c
# Push it to GitHub
git push --set-upstream origin backport/backport-19706-to-2.19
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.19

Then, create a pull request where the base branch is 2.19 and the compare/head branch is backport/backport-19706-to-2.19.

andrross added a commit to andrross/OpenSearch that referenced this pull request Oct 22, 2025
…19706)

A behavior change in [JDK-25][1] means that ClassValue.getFromHashMap
will now wrap any checked exceptions with `java.lang.Error`. The fix is
to wrap checked exceptions in `ClassValue.computeValue` with a specific
RuntimeException wrapper, and then unwrap it later when handling.

[1]: https://bugs.openjdk.org/browse/JDK-8351996

Signed-off-by: Andrew Ross <[email protected]>
Signed-off-by: Ankit Jain <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
(cherry picked from commit 8feb6e1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants