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.
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
net/libp2p: Enforce outbound request-response timeout limits #7222
net/libp2p: Enforce outbound request-response timeout limits #7222
Changes from 6 commits
9f8ca21
190fe89
c3b01da
48f0127
f8e89f4
050c166
13d0094
e862829
1ec4657
caa335d
f992c9c
25891cc
06e3b5c
4fff0f5
d505321
7cdd47a
1e5edb2
7a7ee48
b640010
053d8ca
4d33dfc
296156d
d13f9d7
79ee2d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not retain? Then we don't need collect & remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a tiny borrow-checker issue coming from the sender consuming self: retain will give us
&mut req
and thereq.response
oneshot::Sender consumesself
when we send out thesend(Err(RequestFailure::Network(OutboundFailure::Timeout)))
.We could still avoid the extra alloc by adding an Option over the sender, will have a look if it complicates the code, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this could only be triggered by a bug in libp2p/litep2p?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this could be triggered only by a bug in libp2p (libp2p/rust-libp2p#5429). I expected that the latest libp2p version would solve this issue, however, I could reproduce it on our libp2p kusama validator (and locally):
In this case libp2p produces a timeout event ~4s after we have detected the request as timed out. I'll also have a look at our poll implementation, maybe there's something there