-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Substraction overflow when polling Swarm with custom behaviour #1290
Comments
Thanks for reporting the issue. This is fixed in #1291. Note though that calling |
@romanb , thanks for the info.
Yeah, I've made sure that
But I agree that it should be called outside of |
In our program we have a Swarm which uses a custom
NetworkBehaviour
. After executing that program, within 5 seconds tokio panics.Result
How to reproduce
I tried to narrow down the issue, but I cannot give you an absolute certain cause of that panic. For me, it seems to occur in the following case (both conditions apply):
Kademlia
,mDNS
andPing
.tokio::run()
repeatedly callskademlia.bootstrap()
.Workaround
For our program, we can ensure that
kademlia.bootstrap()
gets called exactly once, after at least one node has been added to the DHT.from:
to:
Alternatively, in the rust-libp2p file
protocols/kad/src/behaviour.rs:1316
the following type can be changed fromusize
toisize
:This seems to solve the issue, but this might some kind of bad hack.
Our full code:
https://hastebin.com/udofedajor.php
The text was updated successfully, but these errors were encountered: