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

Fixes panic in tombstone GC. #2973

Merged
merged 6 commits into from
Apr 28, 2017
Merged

Fixes panic in tombstone GC. #2973

merged 6 commits into from
Apr 28, 2017

Conversation

slackpad
Copy link
Contributor

This fixes #2087 and closes #2582.

@slackpad slackpad requested a review from magiconair April 27, 2017 23:29
t.Fatalf("err: %v", err)
}

for i := 0; i < 1000; i++ {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

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.
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@magiconair
Copy link
Contributor

I think you can also drop the enabled: false from the constructor func but other than that it LGTM.

@slackpad slackpad merged commit 21487ce into master Apr 28, 2017
@slackpad slackpad deleted the b-2087 branch April 28, 2017 16:09
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.

Panic in tombstone_gc.go
2 participants