Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data race between ~Tablet and yb::tablet::Tablet::RegularDbFilesChanged()/ThreadPoolTask::Run #3519

Closed
amitanandaiyer opened this issue Feb 1, 2020 · 2 comments
Assignees
Labels
area/docdb YugabyteDB core features

Comments

@amitanandaiyer
Copy link
Contributor


==================
--
3997 | WARNING: ThreadSanitizer: data race (pid=4924)
3998 | Write of size 1 at 0x7b74000a6c28 by main thread (mutexes: write M293432526442201788):
3999 | #0 pthread_mutex_destroy /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/llvm-7.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1201 (client-test+0x486d03)
4000 | #1 std::__1::mutex::~mutex() <null> (libc++.so.1+0xc0bd5)
4001 | #2 yb::tablet::Tablet::~Tablet() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/tablet/tablet.cc:449:1 (libtablet.so+0x195970)
4002 | #3 std::__1::__shared_ptr_emplace<yb::tablet::Tablet, std::__1::allocator<yb::tablet::Tablet> >::__on_zero_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/memory:3692:23 (libtablet_test_util.so+0x2c0b7)
4003 | #4 std::__1::__shared_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/memory:3526:9 (libtablet_test_util.so+0x2a3fe)
4004 | #5 std::__1::__shared_weak_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/memory:3568 (libtablet_test_util.so+0x2a3fe)
4005 | #6 std::__1::shared_ptr<yb::tablet::Tablet>::~shared_ptr() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/memory:4504 (libtablet_test_util.so+0x2a3fe)
4006 | #7 std::__1::shared_ptr<yb::tablet::Tablet>::reset() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/memory:4639:5 (libtablet.so+0x1f4b33)
4007 | #8 yb::tablet::TabletPeer::CompleteShutdown(yb::StronglyTypedBool<yb::tablet::IsDropTable_Tag>) /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/tablet/tablet_peer.cc:447 (libtablet.so+0x1f4b33)
4008 | #9 yb::tserver::TSTabletManager::CompleteShutdown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/tserver/ts_tablet_manager.cc:1224:11 (libtserver.so+0x1f1ece)
4009 | #10 yb::tserver::TabletServer::Shutdown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/tserver/tablet_server.cc:358:22 (libtserver.so+0x1a478c)
4010 | #11 yb::tserver::enterprise::TabletServer::Shutdown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../ent/src/yb/tserver/tablet_server_ent.cc:68:10 (libtserver.so+0x2143fe)
4011 | #12 yb::tserver::MiniTabletServer::Shutdown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/tserver/mini_tablet_server.cc:169:14 (libtserver.so+0x1739c4)
4012 | #13 yb::MiniCluster::Shutdown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/integration-tests/mini_cluster.cc:347:20 (libintegration-tests.so+0xf8aff)
4013 | #14 yb::client::ClientTest::DoTearDown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/client/client-test.cc:184:17 (client-test+0x526678)
4014 | #15 yb::YBMiniClusterTestBase<yb::MiniCluster>::TearDown() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/integration-tests/yb_mini_cluster_test_base.cc:44:3 (libintegration-tests.so+0x125413)
4015 | #16 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2402:10 (libgmock.so+0x55c6f)
4016 | #17 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2438 (libgmock.so+0x55c6f)
4017 | #18 testing::Test::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2482:3 (libgmock.so+0x35080)
4018 | #19 testing::TestInfo::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2656:11 (libgmock.so+0x362ac)
4019 | #20 testing::TestCase::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2774:28 (libgmock.so+0x36d86)
4020 | #21 testing::internal::UnitTestImpl::RunAllTests() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:4649:43 (libgmock.so+0x430d6)
4021 | #22 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2402:10 (libgmock.so+0x56bdf)
4022 | #23 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:2438 (libgmock.so+0x56bdf)
4023 | #24 testing::UnitTest::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/googletest-release-1.8.0/googletest/src/gtest.cc:4257:10 (libgmock.so+0x42981)
4024 | #25 RUN_ALL_TESTS() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/include/gtest/gtest.h:2233:46 (libyb_test_main.so+0x500b)
4025 | #26 main /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/util/test_main.cc:104:13 (libyb_test_main.so+0x4c4d)
4026 |  
4027 | Previous atomic read of size 1 at 0x7b74000a6c28 by thread T185:
4028 | #0 pthread_mutex_lock /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/src/llvm-7.0.1.src/projects/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4071 (client-test+0x49dbd7)
4029 | #1 std::__1::mutex::lock() <null> (libc++.so.1+0xc0bf5)
4030 | #2 std::__1::lock_guard<std::__1::mutex>::lock_guard(std::__1::mutex&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/__mutex_base:104:27 (libtablet.so+0x197f11)
4031 | #3 yb::tablet::Tablet::RegularDbFilesChanged() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/tablet/tablet.cc:652 (libtablet.so+0x197f11)
4032 | #4 decltype(*(std::__1::forward<yb::tablet::Tablet*&>(fp0)).*fp()) std::__1::__invoke<void (yb::tablet::Tablet::*&)(), yb::tablet::Tablet*&, void>(void (yb::tablet::Tablet::*&)(), yb::tablet::Tablet*&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/type_traits:4286:1 (libtablet.so+0x1cc6a3)
4033 | #5 std::__1::__bind_return<void (yb::tablet::Tablet::*)(), std::__1::tuple<yb::tablet::Tablet*>, std::__1::tuple<>, __is_valid_bind_return<void (yb::tablet::Tablet::*)(), std::__1::tuple<yb::tablet::Tablet*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (yb::tablet::Tablet::*)(), std::__1::tuple<yb::tablet::Tablet*>, 0ul, std::__1::tuple<> >(void (yb::tablet::Tablet::*&)(), std::__1::tuple<yb::tablet::Tablet*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:2216 (libtablet.so+0x1cc6a3)
4034 | #6 std::__1::__bind_return<void (yb::tablet::Tablet::*)(), std::__1::tuple<yb::tablet::Tablet*>, std::__1::tuple<>, __is_valid_bind_return<void (yb::tablet::Tablet::*)(), std::__1::tuple<yb::tablet::Tablet*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>::operator()<>() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:2249 (libtablet.so+0x1cc6a3)
4035 | #7 decltype(std::__1::forward<std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>&>(fp)()) std::__1::__invoke<std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>&>(std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/type_traits:4345 (libtablet.so+0x1cc6a3)
4036 | #8 void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>&>(std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/__functional_base:349 (libtablet.so+0x1cc6a3)
4037 | #9 std::__1::__function::__func<std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*>, std::__1::allocator<std::__1::__bind<void (yb::tablet::Tablet::*)(), yb::tablet::Tablet*> >, void ()>::operator()() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:1562:12 (libtablet.so+0x1cc5ad)
4038 | #10 std::__1::function<void ()>::operator()() const /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:1913:12 (libyb-redis.so+0xe8a54)
4039 | #11 rocksdb::DBImpl::FilesChanged() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/rocksdb/db/db_impl.cc:4350:5 (librocksdb.so+0x336c36)
4040 | #12 rocksdb::DBImpl::BackgroundCallFlush(rocksdb::ColumnFamilyData*) /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/rocksdb/db/db_impl.cc:3276:3 (librocksdb.so+0x335cf3)
4041 | #13 rocksdb::DBImpl::FlushTask::DoRun(yb::PriorityThreadPoolSuspender*) /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/rocksdb/db/db_impl.cc:346:15 (librocksdb.so+0x363ee4)
4042 | #14 rocksdb::DBImpl::ThreadPoolTask::Run(yb::Status const&, yb::PriorityThreadPoolSuspender*) /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/rocksdb/db/db_impl.cc:216:5 (librocksdb.so+0x36037e)
4043 | #15 yb::(anonymous namespace)::PriorityThreadPoolWorker::Run() /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/util/priority_thread_pool.cc:188:26 (libyb_util.so+0x348100)
4044 | #16 decltype(*(std::__1::forward<yb::(anonymous namespace)::PriorityThreadPoolWorker*&>(fp0)).*fp()) std::__1::__invoke<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*&)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&, void>(void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*&)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/type_traits:4286:1 (libyb_util.so+0x349df8)
4045 | #17 std::__1::__bind_return<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), std::__1::tuple<yb::(anonymous namespace)::PriorityThreadPoolWorker*>, std::__1::tuple<>, __is_valid_bind_return<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), std::__1::tuple<yb::(anonymous namespace)::PriorityThreadPoolWorker*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), std::__1::tuple<yb::(anonymous namespace)::PriorityThreadPoolWorker*>, 0ul, std::__1::tuple<> >(void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*&)(), std::__1::tuple<yb::(anonymous namespace)::PriorityThreadPoolWorker*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:2216 (libyb_util.so+0x349df8)
4046 | #18 std::__1::__bind_return<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), std::__1::tuple<yb::(anonymous namespace)::PriorityThreadPoolWorker*>, std::__1::tuple<>, __is_valid_bind_return<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), std::__1::tuple<yb::(anonymous namespace)::PriorityThreadPoolWorker*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>::operator()<>() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:2249 (libyb_util.so+0x349df8)
4047 | #19 decltype(std::__1::forward<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>&>(fp)()) std::__1::__invoke<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>&>(std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/type_traits:4345 (libyb_util.so+0x349df8)
4048 | #20 std::__1::__bind_return<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>, std::__1::tuple<>, std::__1::tuple<>, __is_valid_bind_return<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>, std::__1::tuple<>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>, std::__1::tuple<>, std::__1::tuple<> >(std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>&, std::__1::tuple<>&, std::__1::__tuple_indices<>, std::__1::tuple<>&&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:2216 (libyb_util.so+0x349df8)
4049 | #21 std::__1::__bind_return<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>, std::__1::tuple<>, std::__1::tuple<>, __is_valid_bind_return<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&>, std::__1::tuple<>, std::__1::tuple<> >::value>::type std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >::operator()<>() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:2249 (libyb_util.so+0x349df8)
4050 | #22 decltype(std::__1::forward<std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >&>(fp)()) std::__1::__invoke<std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >&>(std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/type_traits:4345 (libyb_util.so+0x349df8)
4051 | #23 void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >&>(std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >&) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/__functional_base:349 (libyb_util.so+0x349df8)
4052 | #24 std::__1::__function::__func<std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> >, std::__1::allocator<std::__1::__bind<std::__1::__bind<void (yb::(anonymous namespace)::PriorityThreadPoolWorker::*)(), yb::(anonymous namespace)::PriorityThreadPoolWorker*&> > >, void ()>::operator()() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:1562:12 (libyb_util.so+0x349cfd)
4053 | #25 std::__1::function<void ()>::operator()() const /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20191209181439-7fc63d1583-centos/installed/tsan/libcxx/include/c++/v1/functional:1913:12 (libyb-redis.so+0xe8a54)
4054 | #26 yb::Thread::SuperviseThread(void*) /nfusr/centos-gcp-cloud/jenkins-slave-1d3/jenkins/jenkins-github-yugabyte-db-phabricator-24436/build/tsan-clang-dynamic-ninja/../../src/yb/util/thread.cc:739:3 (libyb_util.so+0x381079)
4055


https://jenkins.dev.yugabyte.com/job/github-yugabyte-db-phabricator/24436/artifact/build/tsan-clang-dynamic-ninja/yb-test-logs/tests-client__client-test/ClientTest_TestGetTabletServerBlacklist.log

@bmatican
Copy link
Contributor

bmatican commented Feb 1, 2020

This is likely #3476

Could it be that this is now surfaced more across tests after 38ef51a ? cc @spolitov

@bmatican bmatican added the area/docdb YugabyteDB core features label Feb 1, 2020
@ttyusupov
Copy link
Contributor

Also reproducible with ybd tsan --cxx-test client_ql-stress-test --gtest_filter QLStressTest.RetryWrites -n 100

spolitov added a commit that referenced this issue Feb 25, 2020
…DbFilesChanged()

Summary:
DBImpl invokes FilesChanged after decrementing the number of background flushes and unlocking the mutex in BackgroundCallFlush.
So we could get into a situation when DBImpl destructor already thinks that the background job is done.
But we are calling FilesChanged and it will be invoked for a destroyed RocksDB, that will call the callback on a destroyed Tablet.

Fixed by calling FilesChanged before decrementing number of background flushes.
Did the same in BackgroundCallCompaction.

Also moved TaskPriorityUpdater.Apply to the same place.
It was safe invoke it from that place, but brought confusion that other code could be placed nearby.

Test Plan: ybd tsan --cxx-test client_ql-tablet-test --gtest_filter QLTabletTest.SkewedClocks -n 100 -- -p 4

Reviewers: timur, bogdan, mikhail

Reviewed By: mikhail

Subscribers: raju, ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D8022
@bmatican bmatican closed this as completed Mar 2, 2020
spolitov added a commit that referenced this issue Apr 18, 2020
…and yb::tablet::Tablet::RegularDbFilesChanged()

Summary:
DBImpl invokes FilesChanged after decrementing the number of background flushes and unlocking the mutex in BackgroundCallFlush.
So we could get into a situation when DBImpl destructor already thinks that the background job is done.
But we are calling FilesChanged and it will be invoked for a destroyed RocksDB, that will call the callback on a destroyed Tablet.

Fixed by calling FilesChanged before decrementing number of background flushes.
Did the same in BackgroundCallCompaction.

Also moved TaskPriorityUpdater.Apply to the same place.
It was safe invoke it from that place, but brought confusion that other code could be placed nearby.

Test Plan:
ybd tsan --cxx-test client_ql-tablet-test --gtest_filter QLTabletTest.SkewedClocks -n 100 -- -p 4
Jenkins: auto rebase: no

Reviewers: bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D8322
ngov17 pushed a commit to ngov17/yugabyte-db that referenced this issue Jun 26, 2020
…~Tablet and yb::tablet::Tablet::RegularDbFilesChanged()

Summary:
DBImpl invokes FilesChanged after decrementing the number of background flushes and unlocking the mutex in BackgroundCallFlush.
So we could get into a situation when DBImpl destructor already thinks that the background job is done.
But we are calling FilesChanged and it will be invoked for a destroyed RocksDB, that will call the callback on a destroyed Tablet.

Fixed by calling FilesChanged before decrementing number of background flushes.
Did the same in BackgroundCallCompaction.

Also moved TaskPriorityUpdater.Apply to the same place.
It was safe invoke it from that place, but brought confusion that other code could be placed nearby.

Test Plan:
ybd tsan --cxx-test client_ql-tablet-test --gtest_filter QLTabletTest.SkewedClocks -n 100 -- -p 4
Jenkins: auto rebase: no

Reviewers: bogdan

Reviewed By: bogdan

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D8322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features
Projects
None yet
Development

No branches or pull requests

4 participants