Skip to content

Don't use MEMFILE_MAX as the total multipart memory cap - #1536

Open
gyanu2507 wants to merge 1 commit into
bottlepy:masterfrom
gyanu2507:fix/multipart-mem-limit
Open

gyanu2507 wants to merge 1 commit into
bottlepy:masterfrom
gyanu2507:fix/multipart-mem-limit

Conversation

@gyanu2507

Copy link
Copy Markdown

fixes #1470

MEMFILE_MAX is the per-part spool threshold, but 0.13 also passed it as the parser-wide memory cap. Two files of 60 KiB each then hit Memory limit reached even though each one would have been fine on its own.

Keep MEMFILE_MAX as memfile_limit and set mem_limit to MEMFILE_MAX * 128, which is what the discussion on the issue landed on for a total that still scales if an app lowers or raises the setting.

A couple of files that each stay under the spool threshold can
still add up past 100 KiB and raise MultipartError. Keep
MEMFILE_MAX as the per-part limit and scale the parser-wide cap.
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.

New MultipartParser fails on files above 102400 bytes

1 participant