[AI] Fix multipart memory limit for buffered files#1522
Open
puneetdixit200 wants to merge 1 commit into
Open
Conversation
Allow multipart parsing to keep the existing per-file memory threshold without using that same threshold as the total parser memory limit. Fixes bottlepy#1470 ai-assisted-by: OpenAI GPT-5 License: Public Domain
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.
Fixes #1470.
This keeps
MEMFILE_MAXas the per-file in-memory threshold for multipart uploads, but stops reusing that same 100 KiB value as the parser-wide total memory limit. The parser now uses its existing larger total-memory default while each individual file part still spools to disk once it exceedsMEMFILE_MAX.I manually reviewed the diff and verified the regression path with:
python3 -m unittest test.test_environ.TestRequest.test_multipart_many_small_files_above_memfile_totalpython3 -m unittest test.test_environ test.test_multipartpython3 -m unittest discover -t . -s testgit diff --check HEAD~1..HEADAI disclosure: assisted by OpenAI GPT-5. I reviewed the change and test output before submitting.
License: I explicitly license this contribution as public domain.