rts/STM: Commit tx only if we can lock all affected invariants
AbandonedPublic

Authored by bgamari on Oct 3 2017, 10:59 PM.

Details

Reviewers
simonmar
erikd
fryguybob
austin
Trac Issues
#14310
Summary

Previously stmCommitTransaction would happily commit a transaction, even
if it was only able to lock a fraction of the invariants that it would
affect. This meant that we would end up disconnecting and unlocking
invariants that we never locked. Hilarity ensued. See Trac #14310.

Test Plan

Validate

bgamari created this revision.Oct 3 2017, 10:59 PM
fryguybob requested changes to this revision.Oct 4 2017, 7:45 PM
fryguybob added a subscriber: fryguybob.
fryguybob added inline comments.
rts/STM.c
1347

q2 = q2 -> next_queue_entry instead of q++ right?

This revision now requires changes to proceed.Oct 4 2017, 7:45 PM
bgamari added inline comments.Oct 4 2017, 8:28 PM
rts/STM.c
1347

Oh dear, yes. Good catch. I do wonder how this worked.

bgamari updated this revision to Diff 14276.Oct 4 2017, 8:32 PM

Address @fryguybob's point

fryguybob accepted this revision.Oct 4 2017, 8:52 PM

Looks good to me.

This revision is now accepted and ready to land.Oct 4 2017, 8:52 PM
austin resigned from this revision.Nov 9 2017, 5:41 PM
bgamari abandoned this revision.Fri, Jan 26, 2:42 PM

Unfortunately D4073, D4067, and D4065 weren't quite sufficient to resolve the issue in question. Howver, ultimately we will likely resolve to deprecate the STM invariant mechanism in GHC 8.6. I won't be continuing work on this issue.