-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
don't use a context for closing the ObservedAddrManager #1175
Conversation
60b5098
to
5098b94
Compare
5098b94
to
2cf1c45
Compare
515d043
to
db0bc33
Compare
p2p/protocol/identify/obsaddr.go
Outdated
|
||
oas.mu.Lock() | ||
oas.refreshTimer.Stop() | ||
oas.refreshTimer = nil |
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.
This doesn't work as the worker
might be blocked on the timer channel, creating a race condition.
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.
Eh, we could have a "shutdown" boolean. That or have the worker keep a copy of the timer and/or channel locally instead of reading oas.refreshTimer
.
db0bc33
to
9342776
Compare
This is part of the ongoing effort to stop using contexts to control shutdowns.
Most importantly, this PR removes a dependency on the swarm's
Process
ingo-libp2p/p2p/protocol/identify/obsaddr.go
Line 257 in fd4d2a4