Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

locking: Prevent deadlock by making lock ordering consistent. #16

Merged
merged 1 commit into from
Sep 29, 2016

Conversation

ksedgwic
Copy link
Contributor

I reordered lock acquisition to always be hm first, then gm and finally cm.

Fixes observed deadlock.

@tbg
Copy link

tbg commented Sep 29, 2016

Just curious, did you try with https://github.com/sasha-s/go-deadlock?

@tbg
Copy link

tbg commented Sep 29, 2016

LGTM (but I'm just randomly here and have no power).

@ksedgwic
Copy link
Contributor Author

Just curious, did you try with https://github.com/sasha-s/go-deadlock?

No, we figured it out by looking at a goroutine dump from the deadlocked process.

The go-deadlock project looks cool, thanks for pointing it out!

@codahale codahale merged commit bc2005d into codahale:master Sep 29, 2016
@codahale
Copy link
Owner

Thanks for the diagnosis and fix, @ksedgwic!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants