-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Bug] Abnormal disconnection caused by asynchronous Ping message #3331
Comments
@ljedrz might be of interest to you |
Very cool find; I think I know how to tackle this. |
Ah yes, it seems that #2690 will need to be reopened; a workaround where we would abort ping tasks on disconnect would also work, but the real solution is to delay a peer's promotion to the |
On testnet beta, this issue occurs frequently, caused by the UnconfirmedTransaction and UnconfirmedSolution messages.
|
#3332 should fix this. |
Steps to Reproduce
1.Receive a Pong message from the peer and create an asynchronous task to send a Ping message to the peer after PING_SLEEP_IN_SECS seconds.
snarkOS/node/src/client/router.rs
Lines 248 to 266 in 09aa62b
2.Periodic refresh of peers.
3.Receive a connection request from a peer
4.Complete the handshake, and add the peer to the router.
snarkOS/node/router/src/handshake.rs
Lines 275 to 276 in 09aa62b
5.Create asynchronous tasks for processing, reading, and writing
6.Asynchronous task sleep ends, send Ping message
7.Because the peer has been added to the router, can_send returns true and the Ping message is sent. However, because the writing asynchronous task has not been created, the sending fails.
snarkOS/node/router/src/outbound.rs
Lines 48 to 59 in 09aa62b
8.The reading and writing asynchronous tasks are created later.
This will cause two problems:
Expected Behavior
This shouldn't happen
Your Environment
snarkOS Version: 09aa62b
The text was updated successfully, but these errors were encountered: