Fix HEAD not being retried for HTTP 500 category responses#581
Open
Fix HEAD not being retried for HTTP 500 category responses#581
Conversation
Acconut
requested changes
Apr 14, 2023
Member
Acconut
left a comment
There was a problem hiding this comment.
Thank you! This should fix the problem. Could you please add a case for our test suite?
lib/upload.js
Outdated
| if (status === 423) { | ||
| this._emitHttpError(req, res, 'tus: upload is currently locked; retry later') | ||
| return | ||
| } else if (inStatusCategory(status, 500)) { |
Member
There was a problem hiding this comment.
Let's not use an else if here but just an if. The else should not be necessary.
| return | ||
| } else if (inStatusCategory(status, 500)) { | ||
| // Run retry logic if the server has an error, e.g. 502 Bad Gateway when | ||
| // proxied server is temporarily down. See issue #579. |
Member
There was a problem hiding this comment.
Please mention that we do not want to clear this._url and create a new upload here.
d257b9b to
b4e3693
Compare
Member
|
Thanks for the updates. Only a test case would be nice now:
Let me know if you need help with that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tentative PR to help with #579.
This fixes the immediate issue of key HTTP 500 errors such as
502 Bad Gatewaynot leading to retries.But as described in #579 (comment) I thikn that even more cases should lead to retry.