-
Notifications
You must be signed in to change notification settings - Fork 999
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
libp2p-ping sometimes panics in WASM #5442
Comments
Thanks for the report and good catch. I havent been able to reproduce this myself though during my testing, so out of curiosity was there any specific conditions in which a panic would happen? |
It is a bit hard to reproduce it. In our case sometimes takes 30 minute to reproduce. The following flow triggers it:
More info:
The following fixes the issue in diff --git a/protocols/ping/src/handler.rs b/protocols/ping/src/handler.rs
index b9bd25c52..af7a55a13 100644
--- a/protocols/ping/src/handler.rs
+++ b/protocols/ping/src/handler.rs
@@ -183,6 +183,7 @@ impl Handler {
>,
) {
self.outbound = None; // Request a new substream on the next `poll`.
+ self.interval.reset(Duration::new(0, 0));
let error = match error {
StreamUpgradeError::NegotiationFailed => { |
Thanks for the info. I will see what i can do on my end to reproduce it just out of my curiosity. In the meantime, maybe we should work on getting a patch done here in |
This PR workarounds async-rs/futures-timer#53 issue. Fixes libp2p#5442
I created a repository with reproduction: https://github.com/oblique/libp2p-issue-5442 |
This PR workarounds async-rs/futures-timer#74 issue. Fixes libp2p#5442
This PR workarounds async-rs/futures-timer#74 issue. Fixes #5442 Pull-Request: #5447.
This PR workarounds async-rs/futures-timer#74 issue. Fixes libp2p#5442 Pull-Request: libp2p#5447.
Summary
While researching our eigerco/lumina#256 bug we found one of the causes were bacause libp2p-ping was panicking.
This was due to inconsistent behavior in
futures-timer
when it was used in WASM.Expected behavior
Not to panic
Actual behavior
Panics
Relevant log output
No response
Possible Solution
We fixed the issue with async-rs/futures-timer#74 PR and we are waiting to be reviewed and get merged.
If
futures-timer
rejects or do not merge our fix, then another fix can be applied directly inlibp2p-ping
.Version
No response
Would you like to work on fixing this bug ?
Yes
The text was updated successfully, but these errors were encountered: