Alexey Serbin has uploaded this change for review. ( 
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
---
M src/kudu/master/master.cc
M src/kudu/master/master.h
2 files changed, 4 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/25/15125/1
--
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: newchange
Gerrit-Change-Id: If5122a16bb04f089fe1ec4a0d0ff157164ebfdc4
Gerrit-Change-Number: 15125
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <[email protected]>

Reply via email to