-
Notifications
You must be signed in to change notification settings - Fork 604
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
core: add retry logic to read streams #705
Merged
stephenplusplus
merged 1 commit into
googleapis:master
from
stephenplusplus:spp--storage-universal-handler
Jul 15, 2015
Merged
core: add retry logic to read streams #705
stephenplusplus
merged 1 commit into
googleapis:master
from
stephenplusplus:spp--storage-universal-handler
Jul 15, 2015
Conversation
This file contains 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
googlebot
added
the
cla: yes
This human has signed the Contributor License Agreement.
label
Jul 6, 2015
Both excellent choices :) |
stephenplusplus
force-pushed
the
spp--storage-universal-handler
branch
5 times, most recently
from
July 9, 2015 19:29
bad080e
to
5c202b6
Compare
|
stephenplusplus
force-pushed
the
spp--storage-universal-handler
branch
2 times, most recently
from
July 15, 2015 14:57
64f7209
to
21ff797
Compare
@callmehiphop can you take a look over this and let me know if anything looks 👍 or 👎? |
|
||
return; | ||
callback = callback || util.noop; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
stephenplusplus
force-pushed
the
spp--storage-universal-handler
branch
from
July 15, 2015 15:46
21ff797
to
d439aac
Compare
LGTM! 👍 @stephenplusplus |
stephenplusplus
force-pushed
the
spp--storage-universal-handler
branch
from
July 15, 2015 15:49
d439aac
to
68a4878
Compare
stephenplusplus
added a commit
that referenced
this pull request
Jul 15, 2015
…andler core: add retry logic to read streams
Thanks! |
sofisl
pushed a commit
that referenced
this pull request
Jan 24, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl
pushed a commit
that referenced
this pull request
Jan 25, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
4 tasks
sofisl
pushed a commit
that referenced
this pull request
Sep 13, 2023
samples: pull in latest typeless bot, clean up some comments Source-Link: https://github.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e
4 tasks
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.
Fixes #701
To Dos
file#createReadStream was skipping over the universal response handler logic we have for all API requests our library makes. This is most beneficial for retrying failed requests using the recommended exponential backoff technique. This PR brings retry logic to createReadStream, at the cost of more code complexity, because holy moly, is this tricky with streams.
I wrote up a module that helps with this, retry-request, which also implements exponential backoff the way we had it here.
Here's a simplified example of how this works:
retry-request uses a module called
stream-cache
that stores what it's given, then replays it when a new stream is connected to it. Additionally, retry-request uses an intermediary stream while we figure out if the request is going to flat out fail. It kind of looks like this (simplified, pseudo):Related: AWS streams - See last section "Limitations of Streaming"