-
-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncate SpooledTemporaryFile after flushing the buffer #169
Conversation
Codecov Report@@ Coverage Diff @@
## master #169 +/- ##
==========================================
- Coverage 59.32% 23.6% -35.73%
==========================================
Files 17 18 +1
Lines 1694 1716 +22
==========================================
- Hits 1005 405 -600
- Misses 689 1311 +622
Continue to review full report at Codecov.
|
This should also fix the problem mentioned in issue #160 |
Thanks to you and @iceseyes for bringing this issue up. I'm going to write a failing test with a 5MB file and get this one fixed asap, probably with your fix. I intentionally removed the S3.py file because it was deprecated in the original repo and I wanted to reduce my own maintenance burden, especially of already deprecated pieces of the library. New fork yadda yadda. |
Hi there, This is affecting us badly as well (from a 45MB file we end up with >15GB on S3 before Django give up). Thanks! |
Possibly related: |
Hi, ping on this? We have just encountered an issue where uploading ~10MB of data resulted in ~20GB of data being written to S3 - it looks like this PR is the fix we need. Any possibility of a merge? |
by truncating the buffer after uploading it. Follows the approach of jschneier#169.
When uploading a file in chunks with S3BotoStorageFile I noticed that the underlying SpooledTemporaryFile is never truncated but instead successive write-calls just keep appending the file.
With each flush the file is seeked to the beginning though which results in malformed data on S3 as the contents of the previous flushes are uploaded again and again on each write.
Also added the missing S3.py. License seems to permit it?