-
Notifications
You must be signed in to change notification settings - Fork 54
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
chore: closing ping streams #2692
Conversation
You can find the image built from this PR at
Built from 7a6c35f |
You can find the image built from this PR at
Built from 7a6c35f |
30e0f6d
to
115eccd
Compare
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.
Good catch. Isn't this feature is disabled by default?
Yes! So the feature is disabled by default, but in |
Wait, one question so I can understand this. Are you saying that this behavior were happening only if we had the |
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.
lgtm.
Was wondering why we were not seeing this in waku_streams_peers
but just realized we only consider waku protocols (ping is excluded).
good catch
Yes, if |
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.
LGTM! Thanks! 💯
As a possible future optimization we should only dial
once at the beginning and then keep using that connection on further pings
Then I will need to doublecheck this in our simulations, because we are not using that flag... |
Description
We're opening ping streams every 2 minutes but not closing them. This means we get an ever increasing amount of stale streams. Therefore, closing the stream after the ping.
Changes
Testing
Tested it by calling
nwaku/waku/node/peer_manager/peer_manager.nim
Lines 655 to 671 in a37c9ba
nwaku/waku/node/peer_manager/peer_manager.nim
Lines 673 to 685 in a37c9ba
inside
keepaliveLoop()
and logging the outputsThe conclusions were:
conn.close()
, the output ofgetNumStreams()
grew indefinitelyconn.close()
, the output ofgetNumStreams()
varied but was stableconn.close()
did not affect the output ofconnectedPeers()
, which means that indeed it didn't affect the physical connectionsIssue
closes #2462