python/etl: stream HTTPMultiThreadedServer no-FQN hpush PUT#293
Open
chanu1406 wants to merge 1 commit intoNVIDIA:mainfrom
Open
python/etl: stream HTTPMultiThreadedServer no-FQN hpush PUT#293chanu1406 wants to merge 1 commit intoNVIDIA:mainfrom
chanu1406 wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
- add _RFileLimitedReader: bounded sync reader around self.rfile so transform_stream sees correct EOF without buffering the full body - gate _direct_put_stream_with_retry retries on replayability (bool(fqn) or is_get); skip local retries for one-shot no-FQN PUT bodies - retire BytesIO-seek replay tests; convert three existing retry tests to the replayable GET path Signed-off-by: Chanu Ollala <chanuollala@gmail.com>
773bb8b to
bb7dbf7
Compare
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.
Follow up to #289 — stream no-FQN
hpushPUT requests inHTTPMultiThreadedServerin constant memory.Previously
_get_stream_readerbuffered the full request body into aBytesIObeforetransform_streamran. For large objects this is the same OOM-at-scale concern the GET-side fix addressed.The HTTP server case is simpler than the async FastAPI side:
self.rfileis already a syncBinaryIO, so there's no async/sync bridge needed. The fix is a thin length-bounded wrapper (_RFileLimitedReader) that givestransform_streamthe correct EOF semantics without the full-body allocation.Changes:
_RFileLimitedReader: syncio.RawIOBasesubclass that clampsread()toContent-Lengthremaining bytes_direct_put_stream_with_retry: gate retries on replayability (bool(fqn) or is_get); no-FQN PUT bodies are one-shot so local retries are skipped and a transient direct-put error surfaces to AIS as a transform failure