-
Notifications
You must be signed in to change notification settings - Fork 26
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
Make file upload be robust to file size changes #1373
Comments
What exactly is the goal of re-checking zero-sized files? Are you assuming that, once NFS reports a non-zero size, it will report a non-zero size again when |
To be clear: Do you mean that the total time spent looping should be no more than two seconds or that the individual sleeps should increase up to a maximum of two seconds each? Either way, how many iterations through the loop should there be? |
yes, that is the assumption I have that once it is non-zero, it stays non-zero for the nearest future. I can be proven wrong.
Per my assumption above, I was assuming that it would be the same value used in Content-Length.
It is ok with me if it would be so (as I have mentioned before), we might just need to add a unittest to catch a moment when requests RFs their API so there is no use of that |
individual sleeps of e.g. 100ms (no need to increase delay IMHO), total to 2 sec, so 20 iterations. |
Double-check file sizes before & after uploading
🚀 Issue was released in |
Per request of @jwodder in #1257 (comment) filing it as a separate issue.
Background: As discovered in that issue we caught NFS (or some layer above on the way to Python) lying about file size to be 0 whenever it is not: the reported size gets changed within few seconds. We also spotted S3 failing some uploads due to "Content-MD5 you specified did not match what we received", an exact reason for which we do not know.
So, apparently we cannot really rely on file system to provide us robust file size, and thus we should 1. provide mitigation to the 0-size file issue and to possibly help isolate any other incorrect file size reporting add a safe-guard.
I am filing it as a single issue since IMHO two aspects are very related and likely to be implemented in a concerted effort. I will provide only high level description of desired behavior instead of mandating any particular implementation.
IOError
or other you find more appropriate) exception summarizing size changes, if upload errorred out - just log an ERROR level log message summarizing size changes.The text was updated successfully, but these errors were encountered: