fix: restore fasterxml JsonParseException mapping in ExceptionsHelper.status() (#21612) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #22632
Conversation
….status() (opensearch-project#21612) PR opensearch-project#21029 (Jackson 3.x migration) changed ExceptionsHelper.status() to use org.opensearch.tools.jackson.core.JsonParseException in the switch statement, but com.fasterxml.jackson.core.JsonParseException (fasterxml variant) is still on the classpath and used by plugins. This is a silent behavioral regression. Any plugin that encounters a fasterxml JsonParseException now gets RestStatus.INTERNAL_SERVER_ERROR (500) instead of BAD_REQUEST (400), causing infinite retries in exception-based retry logic. Added fully-qualified fasterxml cases to both status() and summaryMessage() to handle both Jackson 2.x and 3.x variants. [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
❌ Gradle check result for 00719d4: 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? |
|
❌ Gradle check result for 00719d4: 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? |
Description
PR #21029 (Jackson 3.x migration) changed
ExceptionsHelper.status()to useorg.opensearch.tools.jackson.core.JsonParseExceptionin the switch statement, butcom.fasterxml.jackson.core.JsonParseException(fasterxml variant) is still on the classpath and used by plugins.Impact
This is a silent behavioral regression. Any plugin that encounters a fasterxml
JsonParseExceptionnow getsRestStatus.INTERNAL_SERVER_ERROR(500) instead ofBAD_REQUEST(400), causing infinite retries in exception-based retry logic (e.g. opensearch-project/anomaly-detection#1714).Fix
Added fully-qualified
com.fasterxml.jackson.core.JsonParseExceptioncases to bothstatus()andsummaryMessage()methods, so both Jackson 2.x (fasterxml) and 3.x (opensearch-tools) variants are handled correctly.Related Issues
Resolves #21612