[WIP] Refactor ChiStatus internals to make concurrent access safe#1117
[WIP] Refactor ChiStatus internals to make concurrent access safe#1117zcross wants to merge 1 commit intoAltinity:0.21.0from zcross:zcross/concurrency/status
Conversation
Signed-off-by: Zach Cross <[email protected]>
|
Will add a golang concurrent test (for |
|
FYI @sunsingerus : I plan on making my way through each of registry/status/announcer, but thought having a separate PR for each would be valuable in keeping discussion focused (and not missing details due to the size of one big PR) |
|
Update: I'm marking this as a draft for now, will promote back to PR when I have landed the concurrency test coverage and continue plumbing through synchronization into all getter/setter accesses to the status (I'm currently working my way through the medium sized surface area exposed by the combination of I'm pondering a few routes forward:
|
|
Yeah, this is going to be more of a lift than I first thought, so I'm going to close this PR for now and reopen it when the branch is further along. Sorry for the premature draft :) |
|
Whoops, can't reopen this because I rebased/squash after taking a second approach. Will open a new PR. Sorry! |
Background: #1109
Sibling PR(s):
This PR adds
sync.RWMutexbased synchronization over the mutable state ofChiStatus. It should be relatively straightforward.The most eyebrow raising bits are probably in the sequenced lock acquisition in
MergeActionsandCopyFromcreating some risk of deadlocking (to be discussed, I'm sure). The only other potentially "hairy" concern is some of the generated code I've found forDeepCopyhelpers on all types. I think I need to read surrounding code more deeply to understand if there are any indirect deep copies happening (i.e., sidestepping synchronization).Note: I'll squash all commits from feedback pre-merge.
Important items to consider before making a Pull Request
Please check items PR complies to:
next-releasebranch, not intomasterbranch1. More info