fix(chart): close client connections per response to stop 400 on aborted uploads#106
Merged
Merged
Conversation
…ted uploads barman multipart PUT uploads intermittently fail with HAProxy's built-in "400 Bad request". When a backend pod is killed mid-body (KEDA churn + option redispatch), HAProxy responds before the request body is fully read; on a kept-alive client connection the leftover body bytes are then parsed as the next request line, which is not valid HTTP, so HAProxy emits a 400 and the client fails the part. Add option httpclose so a poisoned client connection is never reused. http-server-close would not help: the desync is on the client-facing side.
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.
Problem
barman multipart PUT uploads (CloudNativePG base backups) intermittently fail against
s3proxy-python-frontproxywith HAProxy's built-in error:The
Content-length: 90+Connection: close+text/htmlpage is HAProxy 3.4's own built-in400 Bad request— not from the Python backend or real S3.Root cause
The frontproxy runs
mode httpwith default client keep-alive. During a backup, many concurrent multipart PUTs are in flight. When a backend pod is killed mid-body (KEDA scale-down churn +option redispatch,maxconn 20/pod), HAProxy sends the response before the request body is fully read. On the kept-alive client connection, the leftover upload-body bytes are then parsed as the next request line — not valid HTTP — so HAProxy emits its built-in 400 and closes. barman retries (backups limp through, noisily).Fix
Add
option httpcloseso the client connection is closed after each response and a poisoned connection is never reused.option http-server-closewould not help — the desync is on the client-facing connection, which http-server-close keeps alive.alpn h2), so the known httpclose+h2 400 caveat does not apply.maxconn 4096.Note: the underlying mid-upload aborts (backend pod churn under load) are a separate track (KEDA/memory tuning already in flight). This PR stops the client-visible 400 symptom.