fix: stream ES signed UploadParts to prevent OOM#85
Merged
Conversation
Elasticsearch snapshots send 16MB parts with a real x-amz-content-sha256 hash (not UNSIGNED/STREAMING/aws-chunked). Those fell below the 32MB framed threshold and were fully buffered in both request_handler and UploadPart, causing OOM under concurrent snapshot load. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
request_handlerwhenx-amz-content-sha256is present — the SigV4 verifier uses the header hash directlyclassify_upload()unit tests guarding the ES regressionProd logs showed
upload_path: "buffered"withis_large_signed: falsefor 16MB ES parts, reserving only 8MB while actual peak was ~50MB/request → OOMKilled at 512Mi.Test plan
uv run pytest tests/unit/test_upload_path.py tests/unit/test_routing.py -quv run pytest tests/unit/ -q(431 passed)upload_path: "framed"s3proxy-pythonpods for OOMKilled restarts during ES backup windowMade with Cursor