Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/15125 )

Change subject: [master] fix race in MiniMaster-based scenarios
......................................................................

[master] fix race in MiniMaster-based scenarios

I saw a warning from the ThreadSanitizer while running the
TsTabletManagerITest.TestTableStats scenario (TSAN build).  It turned
to be a test-only race in scenarios where MiniMaster is involved in
single-master test mini-cluster if calling MiniMaster::Shutdown()
after MiniMaster::Start() but before the catalog manager has completed
its initialization.

The relevant snippet from the warning:

WARNING: ThreadSanitizer: data race (pid=6972)
  Write of size 8 at 0x7b7000000c70 by main thread:
    #0 pthread_cond_destroy
    #1 ConditionVariable::~ConditionVariable()
    #2 CountDownLatch::~CountDownLatch()
    #3 Promise<Status>::~Promise()
    #4 Master::~Master() src/kudu/master/master.cc:129
    #5 Master::~Master() src/kudu/master/master.cc:127
    #6 std::__1::default_delete<Master>::operator(Master*)
    #7 std::__1::unique_ptr<Master, 
std::__1::default_delete<Master>>::reset(Master*)
    #8 MiniMaster::Shutdown() src/kudu/master/mini_master.cc:118
...

  Previous read of size 8 at 0x7b7000000c70 by thread T20 (mutexes: write 
M50614):
    #0 pthread_cond_broadcast
    #1 ConditionVariable::Broadcast()
    #2 CountDownLatch::CountDown(int)
    #3 CountDownLatch::CountDown()
    #4 Promise<Status>::Set(Status const&)
    #5 Master::InitCatalogManagerTask() src/kudu/master/master.cc:206
...

Change-Id: If5122a16bb04f089fe1ec4a0d0ff157164ebfdc4
Reviewed-on: http://gerrit.cloudera.org:8080/15125
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <[email protected]>
---
M src/kudu/master/master.cc
M src/kudu/master/master.h
2 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Adar Dembo: Looks good to me, approved

--
To view, visit http://gerrit.cloudera.org:8080/15125
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If5122a16bb04f089fe1ec4a0d0ff157164ebfdc4
Gerrit-Change-Number: 15125
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Volodymyr Verovkin <[email protected]>

Reply via email to