knox-mpu
knox-mpu copied to clipboard
Completes before parts are finished uploading
I'm having trouble tracking down an issue. I'm trying to upload a 7020205724 byte file with each part size set to 20971520 bytes. This results in 335 parts needing to be uploaded.
The issue is that it seems to get lose track of unfinished uploads and pushes the completion xml to S3 before all parts are there. This results in a corrupted file.
I'm logging the completion and finish events to a file for debug purposes and end up with something like this (notice that it thinks there are only 328 parts in the finished upload).
Finished uploading file
Any thoughts? I've been looking through the code and can't quite pinpoint what is happening.
Definitely something weird happening and it is either due to retry or batching logic.
So it is still not detecting that uploads are in progress before .end reaches its callback, so that is weird but it might be because those ones are from previous errors.
Even more weird now is that when it errors the previous calls seem to keep going:
Failed: {"part":166,"message":"Upload failed with status code 400"} Starting uploading part 166. Failed: {"part":166,"message":{"code":"ECONNRESET","errno":"ECONNRESET","syscall":"write"}} Starting uploading part 166. Failed: {"part":166,"message":{"code":"ECONNRESET","errno":"ECONNRESET","syscall":"write"}} Starting uploading part 166. Finished uploading part 166 with ETag "31dbb9efd69f00be48918fc4e5afc935". Finished uploading part 166 with ETag "31dbb9efd69f00be48918fc4e5afc935". Finished uploading part 166 with ETag "31dbb9efd69f00be48918fc4e5afc935".
I'm not sure how that is happening. I figured the previous request object would just stop.