Race condition saving files to S3
See original GitHub issueWhen saving using tus-node-server with the S3 backend the meta data gets saved in a .info
file its metadata.
This file also gets used to reply to a HEAD
request which uppy uses to determine if an upload succeeded (which it does after a PATCH resulted in 502?). So there is a race condition where tus-node-server actually failed in saving the file (hence the 502) but the HEAD call returns that there is a file since tus-node-server only check the meta .info
file.
Any idea how to solve this? Would an extra call to S3 to check if the main file also exists be a solution?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
AWS S3 client race condition solutions - Stack Overflow
The issue arises as a race condition when each client is attempting to download the same file within the aforementioned s3 bucket.
Read more >Race Condition that could Result to RCE - InfoSec Write-ups
Race Condition that could Result to RCE - (A story with an App that temporary stored an uploaded file within 2 seconds before...
Read more >Race condition when you don't even know you're racing
Our first reaction was to verify our own archive: the S3 object we had was correct, data valid, and indeed their checksum didn't...
Read more >Understanding and Handling Race Conditions at DynamoDB
What are Race Conditions? · we're saving votes per candidate in a list at a DynamoDB document. · a Lambda function behind an...
Read more >Storing, Retrieving & Implementing Objects using AWS S3
You can think of S3 as a virtual cloud drive where you can create folders (buckets) to store data files (objects) and specify...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, thanks for pointing me to tusd, will certainly have another look at it (gotta sharpen my go skill haha). Anyway the main issue is the ‘Complete Multipart Upload’ no being called correctly after an upload is done. I tried a few different options but couldn’t solve it reliably. I hope I can get tusd running, cheers!
As far as I know, tus-node-server has little protection against concurrent access which can result in these race conditions as you mentioned. I also don’t know how to solve this but we’re happy to accept a PR if you could supply one.
Alternatively, I would recommend you to consider using another tus server (such as the more mature https://github.com/tus/tusd) as we tus-node-server is in a bad shape right now (see https://github.com/tus/tus-node-server/blob/master/README.md).