Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log a status of 499 if the client cancels the request #68

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

kevinmcconnell
Copy link
Collaborator

@kevinmcconnell kevinmcconnell commented Nov 14, 2024

Previously a client-cancelled request was logged as a proxy error, which is misleading. We can instead log it as 499, which is unambiguous and matches a convention used elsewhere.

Another situation in which requests may be cancelled is where we're forced to terminate incomplete requests during draining, because the drain timeout has expired before they've completed. In that case, we'll respond with a 504 Gateway Timeout, and log some additional context for clarity.

Closes #59

Previously a client-cancelled request was logged as a proxy error, which
is misleading.

The other situation in which requests may be cancelled is where we're
forced to terminate incomplete requests during draining. In this case,
we'll continue to respond with a 502, but add additional context to the
logs for clarity.
If we have to cancel a request because we're draining the target and the
upstream hasn't sent us a response yet, then 504 is arguably a more
appropriate status. The upstream didn't error, it just wasn't fast
enough given the situation.
@kevinmcconnell kevinmcconnell merged commit 68df02c into main Nov 14, 2024
3 checks passed
@kevinmcconnell kevinmcconnell deleted the log-499-on-client-disconnect branch November 14, 2024 14:48
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.

Cancelled requests returning status 502
1 participant