-
Notifications
You must be signed in to change notification settings - Fork 370
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
retryOptions.retryableErrorFn
called with 200 ok for resumable upload
#1851
Comments
Hi @benogle , This is happening here nodejs-storage/src/gcs-resumable-upload.ts Lines 1014 to 1031 in 72f7992
We check all responses and if the retry function returns Lines 258 to 285 in 72f7992
The custom function you've passed in here returns true for every type of response, so it will keep attempting to retry the request. Since |
Right, this is the issue. It feels like the retry function shouldn't be called at all for success responses, and it isn't when
Basically to track when it is retrying, what errors it's retrying, and to ensure it did actually retry if the upload results in an error. For more context, Google storage has been pretty unreliable on upload for us lately. We've been getting a number of 502s and 408s that come out as promise rejections / errors. We had the default retry configuration, but it was unclear if the lib was actually retrying the uploads. After digging into the code, it looks like you possibly need to specify a generation-related param or two to get the lib to actually retry with the default |
I understand that this can be confusing. Thank you for calling it out and explaining a little bit. I've opened a PR that will prevent an accidental retry of a As for |
Environment details
@google-cloud/storage
version: 5.18.3Steps to reproduce
retryOptions.retryableErrorFn
is often called with a plain object containingcode: 200
.If we ignore the
200
s inretryableErrorFn
,cloudFile.save
ultimately succeeds, but it took a while for us to discover we could safely ignore them as we could only reproduce this in production.retryableErrorFn
is called in the upload stream'serror
event, obviously extremely confusing that it's called with a code 200.If we retry the
200
s, it retries until it eventually fails with:The text was updated successfully, but these errors were encountered: