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

feat: purge peer connections and information #194

Merged
merged 5 commits into from
Nov 4, 2024
Merged

feat: purge peer connections and information #194

merged 5 commits into from
Nov 4, 2024

Conversation

gammazero
Copy link
Contributor

Connections to a specific peer, or to all peers, can be closed and the peer information removed from the peer store. This can be useful to help determine if the presence/absence of a connection to a peer is affecting behavior. Be aware that purging a connection is inherently racey as it is possible for the peer to reestablish a connection at any time following a purge.

  • http://$RAINBOW_CTL_LISTEN_ADDRESS/mgr/purge?peer=<peer_id> purges connection and info for peer identifid by peer_id
  • http://$RAINBOW_CTL_LISTEN_ADDRESS/mgr/purge?peer=all purges connections and info for all peers
  • http://$RAINBOW_CTL_LISTEN_ADDRESS/mgr/peers returns a list of currently connected peers

Closes #193

Connections to a specific peer, or to all peers, can be closed and the peer information removed from the peer store. This can be useful to help determine if the presence/absence of a connection to a peer is affecting behavior. Be aware that purging a connection is inherently racey as it is possible for the peer to reestablish a connection at any time following a purge.

- `http://$RAINBOW_CTL_LISTEN_ADDRESS/mgr/purge?peer=<peer_id>` purges connection and info for peer identifid by peer_id
- `http://$RAINBOW_CTL_LISTEN_ADDRESS/mgr/purge?peer=all` purges connections and info for all peers
- `http://$RAINBOW_CTL_LISTEN_ADDRESS/mgr/peers` returns a list of currently connected peers

Closes #193
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, small cosmetics inline that would be nice to address, but no blockers
(feel free to deploy to staging and try to leverage this to reproduce retrieval issue)

handlers.go Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
gammazero and others added 2 commits November 4, 2024 12:39
Co-authored-by: Marcin Rataj <lidel@lidel.org>
@gammazero gammazero merged commit 54dbdda into main Nov 4, 2024
10 checks passed
@gammazero gammazero deleted the purge-peers branch November 4, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Endpoint to purge libp2p connection
2 participants