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

circuit v2: relay service not cleaned up properly on close #2162

Closed
sukunrt opened this issue Mar 2, 2023 · 0 comments · Fixed by #2164
Closed

circuit v2: relay service not cleaned up properly on close #2162

sukunrt opened this issue Mar 2, 2023 · 0 comments · Fixed by #2164

Comments

@sukunrt
Copy link
Member

sukunrt commented Mar 2, 2023

There is a race condition between


relay.Close()

and


relay.handleReserve()

if relay.Close() is called around handleReserve execution at:
https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/circuitv2/relay/relay.go#L181
if relay.Close acquires the lock it'll untag the peers and cancel the background goroutine running the gc.
Then handleReserve will add the reservation and tag the peer with conn manager.

@sukunrt sukunrt changed the title circuit v2: relay service not cleaned up properly close circuit v2: relay service not cleaned up properly on close Mar 2, 2023
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 a pull request may close this issue.

1 participant