-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
resolved #407: Allocation failure when uploading larger files. #408
Conversation
eric2788
commented
Feb 19, 2024
•
edited
Loading
edited
- there are some additional revises for optimization, feel free to remove them
- there are some differences between this branch (not tested) and my current one (tested), so testing is required
ae38bc8
to
88b29ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to work on my local machine. I am test uploading a 1GB file and it is hanging up. Not sure what the issue is, and the retries aren't incrementing either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some issues I found when testing the action. I have also gotten a 502 Bad Gateway error and no aborting of the upload.
break; | ||
} catch (err: any) { | ||
retries++; | ||
console.error(`R2 Error - ${err.message}, retrying: ${retries}/${config.maxTries}`, err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a socket hang up error here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it without error details ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is with error details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can u show me the error details?
await sleep(300); | ||
} | ||
} | ||
if (retries >= config.maxTries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to run. I still have pending multipart uploads in my R2 bucket, and I've let the program run for a little bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never met upload failed, so I didn't verify this, is there any way to reproduce the error ?
I will create a testing branch for this, so I may show you the test results ASAP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will test the action again, making sure it wasn't a R2 issue.
a54cf7c
to
07ea5e3
Compare
@ryand56 hey there, I just created a GitHub action for testing this branch: https://github.com/eric2788/r2-upload-action/actions/runs/8129299163/job/22216229621 original: successfully uploaded:
broken format is normal because the original one already was |
I still got no idea how to test multipart upload fail 🤔 , the retries' mechanism still being unsure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna say this works, since I uploaded one part until the socket hang up error appeared (maybe my internet). Error for reference:
R2 Info - Uploading tests/assets//1GB.bin (1.00 GB) to test-assets\1GB.bin R2 Success - Uploaded part 10.00 MB/1.00 GB of tests/assets//1GB.bin (1) R2 Error - socket hang up, retrying: 1/5 Error [TimeoutError]: socket hang up at connResetException (node:internal/errors:717:14) at TLSSocket.socketOnEnd (node:_http_client:526:23) at TLSSocket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ECONNRESET', '$metadata': { attempts: 3, totalRetryDelay: 187 } }
Although, one question, does this overwrite files?
Only hit the complete upload request will overwrite files if the file key exist (just what's r2 does) |
Seems socket hang up error is unrecoverable because it immediately exits the process without continuing the statement 🤔 |
Hmm, not sure why it's doing that, but I'll try to fix it in the new version |
* resolved #407: Allocation failure when uploading larger files. * added concurrent multipart upload support (faster upload) * [skip ci] Update mappings --------- Co-authored-by: r2-action-bot[bot] <118486773+r2-action-bot[bot]@users.noreply.github.com>