-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
s3s-fs: fix incomplete uploads by writing via a temp file #116
Conversation
80135cc
to
f3cc793
Compare
f3cc793
to
298c268
Compare
Using temp files is a good practice. Is there any existing library for this? |
I had concerns about additional dependencies. If this is not an issue it would be indeed better IMO. IIRC, temp files get cleared automatically on process exit, so the startup loop would go away. There's a few things I spotted and didn't address:
|
It turns out using a tempfile here might not be easy. |
I've now raised a second PR (#117) that completes this one addressing the latter of these two outstanding items. The last release was in September, any chance you'd be able to cut a new release over the next few days? It would cut down our CI times. |
Ok. The next release is scheduled for Dec 9th. |
I've noticed that occasionally put object requests would result in empty or partially written objects.
After a bit of debugging this turned out to be cases where the S3 client or
s3s-fs
was interrupted/killed mid-upload.The current implementation writes directly to the final destination, which can cause partial writes.
This PR writes to a temporary file path first, then moves to the final location.
This should also take care of cases when the
s3s-fs
was killed abruptly mid-write.To handle this, there's also a start-up clean-up of any leftover outstanding partially written files.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.