-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fixes panic in tombstone GC. #2973
Conversation
consul/state/tombstone_gc_test.go
Outdated
t.Fatalf("err: %v", err) | ||
} | ||
|
||
for i := 0; i < 1000; i++ { |
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.
What does this test? Why 1000
? What is the failure 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.
This would repro the panic, but probably isn't useful as an ongoing unit test since it's not super deterministic (I had to push it up to 1000 to get it to fail). I'll remove it.
consul/state/tombstone_gc.go
Outdated
expireCh chan uint64 | ||
|
||
// lock is used to ensure safe access to all the fields | ||
// lock is used to ensure safe access to all the fields. |
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.
If lock
guards everything then you can embed sync.Mutex
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.
Done.
I think you can also drop the |
This fixes #2087 and closes #2582.