Repository navigation
proxy: report backend outcomes for completed upgrades - #4438
Merged
MustafaSaber merged 2 commits intoNov 20, 2026
Merged
Conversation
Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
A handled response is not necessarily a backend failure. Carry the outcome of the upgrade handler to circuit breaker and backend-error accounting while preserving handled-response and connection cleanup behavior. Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
Member
|
@perfloop-agent can you create the PR to |
Contributor
Author
|
@szuecs Done: the PR now targets The |
szuecs
approved these changes
Nov 16, 2026
MustafaSaber
approved these changes
Nov 20, 2026
szuecs
pushed a commit
that referenced
this pull request
Nov 24, 2026
A completed experimental protocol upgrade currently counts as a failed backend request. This can open the circuit breaker for a healthy backend and reject later requests with 503. Return the backend outcome from the upgrade handler separately from the marker that says the response was already handled. Completed tunnels and fully forwarded non-5xx backend responses report success; dial failures, incomplete HTTP responses, and backend 5xx responses retain their failure accounting. Response writing and connection cleanup are unchanged. The route backend-error counter no longer counts completed upgrades or fully forwarded responses below 500 as errors; a 401 upgrade response also counts as success. `proxy/upgrade_breaker_test.go` exchanges a WebSocket message, waits for handler completion, and then checks a healthy request using the same breaker key. The other cases cover a rejected upgrade, refused connections, server errors, an incomplete response, and resetting previous consecutive failures. The focused Go proxy tests passed with the race detector, covering upgrade responses and audit logging, circuit-breaker states, retries, and error-response filters. Scoped vet, staticcheck, and formatting checks also passed. This applies when `ExperimentalUpgrade` is enabled and a circuit breaker applies to the outgoing host. Active tunnels are accounted for when the upgrade handler returns. Fixes #4437. [Case and evidence](<https://app.perfloop.ai/t/oss/case_vq976y36j2>) --- Made by [Perfloop](https://app.perfloop.ai). Human sponsor: [Tomás Senart](https://github.com/tsenart). --------- Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]>
szuecs
pushed a commit
that referenced
this pull request
Dec 1, 2026
A completed experimental protocol upgrade currently counts as a failed backend request. This can open the circuit breaker for a healthy backend and reject later requests with 503. Return the backend outcome from the upgrade handler separately from the marker that says the response was already handled. Completed tunnels and fully forwarded non-5xx backend responses report success; dial failures, incomplete HTTP responses, and backend 5xx responses retain their failure accounting. Response writing and connection cleanup are unchanged. The route backend-error counter no longer counts completed upgrades or fully forwarded responses below 500 as errors; a 401 upgrade response also counts as success. `proxy/upgrade_breaker_test.go` exchanges a WebSocket message, waits for handler completion, and then checks a healthy request using the same breaker key. The other cases cover a rejected upgrade, refused connections, server errors, an incomplete response, and resetting previous consecutive failures. The focused Go proxy tests passed with the race detector, covering upgrade responses and audit logging, circuit-breaker states, retries, and error-response filters. Scoped vet, staticcheck, and formatting checks also passed. This applies when `ExperimentalUpgrade` is enabled and a circuit breaker applies to the outgoing host. Active tunnels are accounted for when the upgrade handler returns. Fixes #4437. [Case and evidence](<https://app.perfloop.ai/t/oss/case_vq976y36j2>) --- Made by [Perfloop](https://app.perfloop.ai). Human sponsor: [Tomás Senart](https://github.com/tsenart). --------- Signed-off-by: Perfloop Agent <[email protected]> Signed-off-by: Tomás Senart <[email protected]> Signed-off-by: Sandor Szücs <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A completed experimental protocol upgrade currently counts as a failed backend request. This can open the circuit breaker for a healthy backend and reject later requests with 503.
Return the backend outcome from the upgrade handler separately from the marker that says the response was already handled. Completed tunnels and fully forwarded non-5xx backend responses report success; dial failures, incomplete HTTP responses, and backend 5xx responses retain their failure accounting. Response writing and connection cleanup are unchanged. The route backend-error counter no longer counts completed upgrades or fully forwarded responses below 500 as errors; a 401 upgrade response also counts as success.
proxy/upgrade_breaker_test.goexchanges a WebSocket message, waits for handler completion, and then checks a healthy request using the same breaker key. The other cases cover a rejected upgrade, refused connections, server errors, an incomplete response, and resetting previous consecutive failures.The focused Go proxy tests passed with the race detector, covering upgrade responses and audit logging, circuit-breaker states, retries, and error-response filters. Scoped vet, staticcheck, and formatting checks also passed.
This applies when
ExperimentalUpgradeis enabled and a circuit breaker applies to the outgoing host. Active tunnels are accounted for when the upgrade handler returns.Fixes #4437.
Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.