Skip to content
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: close stale ping connections #2462

Closed
gabrielmer opened this issue Feb 20, 2024 · 2 comments · Fixed by #2692
Closed

chore: close stale ping connections #2462

gabrielmer opened this issue Feb 20, 2024 · 2 comments · Fixed by #2692
Assignees
Labels
enhancement New feature or request

Comments

@gabrielmer
Copy link
Contributor

Background

A node pings its peers every 2 minutes in

nwaku/waku/node/waku_node.nim

Lines 1072 to 1073 in 56ff30c

let conn = await node.switch.dial(peer.peerId, peer.addrs, PingCodec)
let pingDelay = await node.libp2pPing.ping(conn)

However the connections are never closed

We rely on libp2p's default connection limits. For example
proc withMplex*(b: SwitchBuilder, inTimeout = 5.minutes, outTimeout = 5.minutes, maxChannCount = 200): SwitchBuilder

If that's not set by libp2p (what has happened us with yamux), the number of connections grows indefinitely.
We should close unused connections ourselves.

Acceptance criteria

Unused connections are deliberately closed

@alrevuelta
Copy link
Contributor

Good catch. Slightly related: #1737

At some point we considered disabling/removing keepAlive, but we ended up just disabling it. The feature its still there and used by eg waku-simulator. While it's not the root cause of this issue, removing it should fix the problem. At this point, I'm not sure it makes sense to have it.

cc @vpavlin Guess your network monitor will get crazy with this?

@chair28980 chair28980 added the enhancement New feature or request label Feb 27, 2024
@chair28980 chair28980 moved this to To Do in Waku Feb 27, 2024
@chair28980
Copy link
Contributor

Not urgent as its handled by libp2p timeouts, but is a nice-to-have.

@gabrielmer gabrielmer self-assigned this May 10, 2024
@gabrielmer gabrielmer moved this from To Do to In Progress in Waku May 10, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Waku May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants