fix(libp2phttp): bound NewStream timeout#3225
Merged
MarcoPolo merged 2 commits intolibp2p:masterfrom Mar 19, 2025
Merged
Conversation
5e6a652 to
802eb9d
Compare
Collaborator
|
Thanks. I like this change, but I don't love that it brings in basichost as a dependency. It might be better to simply copy the default timeout to this package instead. |
Contributor
Author
|
Thanks for the review. Fixed. |
MarcoPolo
approved these changes
Mar 17, 2025
Merged
sukunrt
pushed a commit
that referenced
this pull request
Mar 24, 2025
sukunrt
pushed a commit
that referenced
this pull request
Mar 24, 2025
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.
libp2phttp.streamRoundTripper.RoundTripuses a context fromhttp.Requestwhen establishing a new stream.Suppose a user expects to fetch very large files with multiplexed http so they set very large timeout into
http.Requestcontext. Then suppose one of the servers does not respond to protocols negotiation for some reason (for example by reaching out max connections set via resource manager).This makes
NewStreamto stuck in reading server response for potentially for very long time until the context with high timeout value expires.Tested manually.