Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/14250 )
Change subject: messenger: adjust lock usage ...................................................................... Patch Set 1: (3 comments) http://gerrit.cloudera.org:8080/#/c/14250/1//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/14250/1//COMMIT_MSG@11 PS1, Line 11: take the lock in the destructor > Does it make sense to replace closing_ with atomic and don't guard it with We could, but in ShutdownInternal we need to atomically write closing_, acceptor_pools_, and rpc_services_, so we'd need to take a lock there anyway (even if closing_ were atomic). http://gerrit.cloudera.org:8080/#/c/14250/1//COMMIT_MSG@18 PS1, Line 18: but one way to avoid it > Does it mean it's not possible to fix the Messenger lifecycle issue (if any This isn't a data race; it's a lock inversion. Meaning, the two operations listed by TSAN did not happen "simultaneously" per se, they just acquired locks in the opposite order, which _could_ lead to a deadlock. But, I have no idea how, in reactor.cc:499, we release the last ref to a Messenger _while holding the vmodule lock_. I looked at how the VLOG macros work and there's a new scope declared for InitVLOG3__, so the vmodule lock should be released before moving on to the line of code after the VLOG call. http://gerrit.cloudera.org:8080/#/c/14250/1/src/kudu/rpc/messenger.cc File src/kudu/rpc/messenger.cc: http://gerrit.cloudera.org:8080/#/c/14250/1/src/kudu/rpc/messenger.cc@a431 PS1, Line 431: > Just to be clear, is this not needed because the destructor is guaranteed t Correct. That's a guarantee for any object, including those with shared ownership. -- To view, visit http://gerrit.cloudera.org:8080/14250 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1fd93c06b14bc97a9ac4a37a5b6ca55ffa38f544 Gerrit-Change-Number: 14250 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Wed, 18 Sep 2019 16:53:58 +0000 Gerrit-HasComments: Yes
