Skip to content

fix: map unexpected reranking gateway error - #2530

Open
erichare wants to merge 3 commits into
mainfrom
fix/reranking-error-recovery
Open

fix: map unexpected reranking gateway error#2530
erichare wants to merge 3 commits into
mainfrom
fix/reranking-error-recovery

Conversation

@erichare

@erichare erichare commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

Fixes the reranking gateway failure:

No enum constant io.stargate.sgv2.jsonapi.exception.SchemaException.Code.UNEXPECTED_SERVER_ERROR

RerankingEGWClient assumed every error code returned by Embedding Gateway was a SchemaException.Code. Embedding Gateway uses ServerException.Code.UNEXPECTED_SERVER_ERROR for non-API exception failures, so that enum lookup masked the original provider failure with an IllegalArgumentException.

This change maps that known server code back to ServerException, then leaves the existing schema-error path unchanged. It preserves the public SERVER_UNEXPECTED_SERVER_ERROR identity used by responses and metrics while retaining the original gateway error body.

Validation:

  • 3 focused gateway-client tests passed
  • all 3,421 unit tests passed on Java 21
  • all 819 production and 351 test sources compiled
  • all 1,156 Java files passed formatting
  • git diff --check passed

Which issue(s) this PR fixes:

N/A — follow-up to the GPU-plane concurrency investigation.

Checklist

  • Changes manually tested after deployment
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 52.98% 🍏
Files changed 100% 🍏

File Coverage
RerankingEGWClient.java 82.17% 🍏

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 71.42% -0.02% 🍏
Files changed 0%

File Coverage
RerankingEGWClient.java 0% -15.92%

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 72.74% -0.02% 🍏
Files changed 0%

File Coverage
RerankingEGWClient.java 0% -15.92%

@erichare erichare changed the title fix: handle transient reranking provider failures fix: map unexpected reranking gateway error Aug 5, 2026
@erichare
erichare requested a review from amorton August 5, 2026 19:11
@erichare
erichare marked this pull request as ready for review August 5, 2026 19:11
@erichare
erichare requested a review from a team as a code owner August 5, 2026 19:11
@erichare

erichare commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@amorton i know this might be more of a workaround than a solution, so i understand if you just want to discard it and "do it right", and im happy to spend more time. But was wondering if you think doing something like this could be a temporary way to improve the situation, at least allowing us to more easily see the root nvidia error?

Edit: my thought was we could at least perhaps deploy this to dev to help debug the underlying errors we're seeing more easily, but let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant