Skip to content

fix: return 500 on internal failures#1053

Open
jranson wants to merge 1 commit into
trickstercache:mainfrom
jranson:jr/proxy-error-200
Open

fix: return 500 on internal failures#1053
jranson wants to merge 1 commit into
trickstercache:mainfrom
jranson:jr/proxy-error-200

Conversation

@jranson

@jranson jranson commented Jul 7, 2026

Copy link
Copy Markdown
Member

Description

This fixes the remaining cases outlined in #1018 - when a 200 response is received from a backend but trickster internally fails to handle the request (e.g., unmarshal failure). Other cases where a 200 was being returned instead of 5xx are already addressed. With this change, instead of proxying the 200 response to the caller on internal failures, the response code is now changed to 500 Internal Server Error before responding. When the internal failure is on one or more shards of a TSM operation, the TSM handles the failure(s) the same as if the failure came from the remote origin. Related tests are updated with the new expectation.

Type of Change

    • Bug fix
    • New feature
    • Optimization
    • Test coverage
    • Documentation
    • Infrastructure

AI Disclosure

    • This contribution DOES NOT include AI-generated changes
    • This contribution DOES include AI-generated changes, and I have reviewed the relevant contributing guidelines.

Signed-off-by: James Ranson <james@ranson.org>
@jranson jranson requested a review from a team as a code owner July 7, 2026 17:27

@houyuwushang houyuwushang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small question: should dpcProxyErrorStatusCode also normalize 3xx statuses? fetchExtents treats any resp.StatusCode != http.StatusOK as a failed extent, so an all-3xx DPC failure would still be recorded as proxy-error but respond with that 3xx instead of a 5xx. If preserving upstream redirects/statuses is intentional here, this is fine; I just wanted to check because #1018 frames proxy-error responses as needing a 5xx.

@jranson

jranson commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Currently none of the supported backends that use DPC (prometheus, influxdb, clickhouse) return 3xx responses to a Trickster request (no redirects, and Trickster does not send If-Modified-Since headers to time series backends), so this should not be an issue.

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.

2 participants