Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/16414 )
Change subject: IMPALA-9046: Profile counter that indicates if a JVM pause occurred ...................................................................... Patch Set 4: (1 comment) http://gerrit.cloudera.org:8080/#/c/16414/4/be/src/util/memory-metrics.cc File be/src/util/memory-metrics.cc: http://gerrit.cloudera.org:8080/#/c/16414/4/be/src/util/memory-metrics.cc@281 PS4, Line 281: upgrade_to_unique_lock<shared_mutex> writer_lock(read_lock); I don't believe this upgrade lock pattern is safe. I've had past bad experiences with the upgrade_lock concept in boost and I think it's best to avoid it. I think it only makes sense if there is only ever one writing thread. Problem here is if you have 2 threads trying to upgrade at the same time, you get a deadlock - neither can upgrade because the other has shared ownership. I think it's better instead to release the shared lock, acquire an exclusive lock, then check the condition again. -- To view, visit http://gerrit.cloudera.org:8080/16414 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idbaae2f9142b8be94532a0a147668a3d96091b0b Gerrit-Change-Number: 16414 Gerrit-PatchSet: 4 Gerrit-Owner: Sahil Takiar <stak...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Sahil Takiar <stak...@cloudera.com> Gerrit-Reviewer: Tamas Mate <tm...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Comment-Date: Tue, 22 Sep 2020 19:43:38 +0000 Gerrit-HasComments: Yes