Skip to content

fix: return 502 for errors caused by particular upstream configuration#381

Draft
adubovik wants to merge 3 commits intodevelopmentfrom
fix/report-500-errors-from-upstream-as-502
Draft

fix: return 502 for errors caused by particular upstream configuration#381
adubovik wants to merge 3 commits intodevelopmentfrom
fix/report-500-errors-from-upstream-as-502

Conversation

@adubovik
Copy link
Collaborator

@adubovik adubovik commented Jan 30, 2026

Logical follow-up of #378

DIAL Core upstream is identified by its endpoint and an optional key.
This information is passed to the adapter in request headers X-UPSTREAM-ENDPOINT and X-UPSTREAM-KEY.

Whenever the adapter encounters an upstream endpoint error linked to the endpoint identity (those upstream-specific headers), it should return 502 to signal to DIAL Core to try another endpoint.

Status code translation examples

Status code from upstream Status code from adapter Comment
400 400 Since an invalid request is very likely to trigger the same 400 error, retries with other upstreams won't help.
500 502 The upstream encountered an internal error specific to that upstream; retries may help.
401/403 (X-UPSTREAM-KEY header present) 502 The upstream key was likely misconfigured, so it makes sense to try another upstream.
401/403 (X-UPSTREAM-KEY header missing) 401/403 The adapter tries to authenticate via Azure AD and fails. Retries won't help.

@adubovik adubovik self-assigned this Jan 30, 2026
@adubovik
Copy link
Collaborator Author

adubovik commented Jan 30, 2026

/deploy-review

GitHub actions run: 21515770740

Stage Status
deploy-review Success ✅
chat Success ✅

@adubovik adubovik marked this pull request as draft January 30, 2026 15:11
@adubovik adubovik changed the title fix: return 502 for errors specific for upstream configuration fix: return 502 for errors specific to upstream configuration Feb 2, 2026
@adubovik adubovik changed the title fix: return 502 for errors specific to upstream configuration fix: return 502 for errors caused by particular upstream configuration Feb 2, 2026
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