-
Notifications
You must be signed in to change notification settings - Fork 605
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
Add retries in case of a socket hangup on HTTP #2255
Conversation
Response to googleapis#2254 Should hopefully catch the issue customers are seeing in Google Cloud Functions where google APIs get into a permanent failed state.
Fix silly typo
Thanks for this! I can't think of a reason why we shouldn't retry on this type of error, but before we merge, I just want to make sure we're consistent between our different API request transport layers (we have 3):
And one more thought, since we're re-thinking this-- are there any other similar errors we should retry on? |
Is there any way to npm install @google-cloud/storage at this commit? I cannot figure out how to get this into my firebase functions project. Any help would be greatly appreciated! I've tried every recommended syntax on the google machine and nothing is working. |
Sorry @s2young, there isn't a way to use this with npm due to our mono-repo for multiple packages. cc @swcloud @lukesneeringer -- any thoughts on if we should retry on this error, and if there are any others? |
This module is pretty much unusable on Firebase Functions without some change - at least with respect to interacting with Cloud Storage. I can confirm that after the timeout period the only way to get my functions working is to redeploy them. Thanks! |
Sorry to pester, but this issue is REALLY a problem for me. What about a way to programmatically reconnect? A setting I can pass in when instantiating the @google-cloud/storage object? Anything?! |
The solution for this goes a bit deeper into a dependency module, There is a bit of complexity to how this is solved. Currently,
Any thoughts are welcome. |
My personal vote is for number 2 (and soon). I can continue developing the solution I'm working on, but cannot launch anything until this is resolved. Thanks! |
With respect to option 1, why would a user not want to retry? The user is interfacing with a method that is supposed to upload/setMetadata/getMetadata/etc. What about going with option 2, and rejecting the promise after a user-configurable timeout? A timeout option could give the user flexibility enough to move on with their program, while having the nature of the failure in the rejection. |
I prefer that option as well. I put out a release with this change. If you un- and re-install @google-cloud/storage, you should have the new code. Can you let me know if it works? |
So far so good! Thanks so much! |
Ok, maybe I spoke too soon. It's definitely better but I'm still seeing the ECONNRESET. My scenario is the following:
In my testing I'm uploading 16 images, and sometimes it works for all 16. But equally often, I'll only get 14 or 15 out of 16 properly updated in the Db. |
Thanks for letting me know. The change to retry-request allows 3 total failures. Upping that number might be a naive solution, so I'm going to start with what was described in #2254, and modify as necessary to try to reproduce and hopefully become more aware of the underlying issue. |
Carried the conversation over to #2254. |
Fixes #2254
Should hopefully catch the issue customers are seeing in Google Cloud Functions where google APIs get into a permanent failed state.