-
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
Cancel node context after StopAll #8289
Conversation
slasher/node/node.go
Outdated
@@ -150,11 +150,11 @@ func (s *SlasherNode) Close() { | |||
defer s.lock.Unlock() | |||
|
|||
log.Info("Stopping hash slinging slasher") | |||
s.cancel() |
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.
The same bug-prone code as in the beacon node - cancelling the parent context before StopAll
is called.
Codecov Report
@@ Coverage Diff @@
## develop #8289 +/- ##
==========================================
Coverage ? 57.12%
==========================================
Files ? 449
Lines ? 31524
Branches ? 0
==========================================
Hits ? 18007
Misses ? 10719
Partials ? 2798 |
Conflict and tests failing |
3dc942b
It's the duplicate wallet import test that is failing. It's causing problems in all of our PRs. |
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.
I had not implemented this for validator because the struct did not contain |
What type of PR is this?
Other
What does this PR do? Why is it needed?
#7625 removed context cancelling from the beacon node because it caused a panic - cancelling the parent context before
StopAll
, during which services are being shut down, caused child contexts inside these services to be cancelled before services had a chance to clean themselves up.Last week me and @prestonvanloon discussed some related issue and it occurred to us that it's safe to cancel the parent context after all child contexts have already done their job, i.e. after
StopAll
. This PR adopts this solution.Which issues(s) does this PR fix?
N/A
Other notes for review
So simple yet so clever.