You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@ip-10-146-233-104.ec2.internal> on 2016/02/02 00:34:32 UTC
[kudu-CR] Fix a TSAN race on Webserver::path_handlers_
Todd Lipcon has uploaded a new change for review.
http://gerrit.cloudera.org:8080/1981
Change subject: Fix a TSAN race on Webserver::path_handlers_
......................................................................
Fix a TSAN race on Webserver::path_handlers_
This fixes a race that showed up on the flaky dashboard.
BootstrapPageHeader accesses path_handlers_ without a lock,
whereas RegisterPathHandler() mutates it with a lock.
LinkedListTest.TestLoadAndVerify: WARNING: ThreadSanitizer: data race (pid=20150) Write of size 8 at 0x7d480000bca0 by main thread:
#0 std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) <null> (libstdc++.so.6+0x0000000b072e)
#1 std::_Rb_tree_iterator<std::pair<std::string const, kudu::Webserver::PathHandler*> > std::_Rb_tree<std::string, std::pair<std::string const, kudu::Webserver::PathHandler*>, std::_Select1st<std::pair<std::string const, kudu::Webserver::PathHandler*> >, std::less<std::string>, std::allocator<std::pair<std::string const, kudu::Webserver::PathHandler*> > >::_M_insert_<std::pair<std::string, kudu::Webserver::PathHandler*> >(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string, kudu::Webserver::PathHandler*>&&) /data1/jenkins-workspace/kudu-workspace/thirdparty/installed-deps-tsan/gcc/include/c++/4.9.3/bits/stl_tree.h:1145:7 (libserver_process.so+0x000000091dcb)
#2 std::pair<std::_Rb_tree_iterator<std::pair<std::string const, kudu::Webserver::PathHandler*> >, bool> std::_Rb_tree<std::string, std::pair<std::string const, kudu::Webserver::PathHandler*>, std::_Select1st<std::pair<std::string const, kudu::Webserver::PathHandler*> >, std::less<std::string>, std::allocator<std::pair<std::string const, kudu::Webserver::PathHandler*> > >::_M_insert_unique<std::pair<std::string, kudu::Webserver::PathHandler*> >(std::pair<std::string, kudu::Webserver::PathHandler*>&&) /data1/jenkins-workspace/kudu-workspace/thirdparty/installed-deps-tsan/gcc/include/c++/4.9.3/bits/stl_tree.h:1501:14 (libserver_process.so+0x000000091ae8)
#3 std::pair<std::_Rb_tree_iterator<std::pair<std::string const, kudu::Webserver::PathHandler*> >, bool> std::map<std::string, kudu::Webserver::PathHandler*, std::less<std::string>, std::allocator<std::pair<std::string const, kudu::Webserver::PathHandler*> > >::insert<std::pair<std::string, kudu::Webserver::PathHandler*>, void>(std::pair<std::string, kudu::Webserver::PathHandler*>&&) /data1/jenkins-workspace/kudu-workspace/thirdparty/installed-deps-tsan/gcc/include/c++/4.9.3/bits/stl_map.h:638:18 (libserver_process.so+0x00000008a3d8)
#4 kudu::Webserver::RegisterPathHandler(std::string const&, std::string const&, boost::function<void ()(kudu::WebCallbackRegistry::WebRequest const&, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*)> const&, bool, bool) /data1/jenkins-workspace/kudu-workspace/src/kudu/server/webserver.cc:384:10 (libserver_process.so+0x000000088eff)
#5 kudu::Webserver::Start() /data1/jenkins-workspace/kudu-workspace/src/kudu/server/webserver.cc:217:3 (libserver_process.so+0x000000087c47)
#6 kudu::server::ServerBase::Start() /data1/jenkins-workspace/kudu-workspace/src/kudu/server/server_base.cc:313:3 (libserver_process.so+0x000000075478)
#7 kudu::tserver::TabletServer::Start() /data1/jenkins-workspace/kudu-workspace/src/kudu/tserver/tablet_server.cc:123:3 (libtserver.so+0x00000012cb4a)
#8 kudu::tserver::TabletServerMain(int, char**) /data1/jenkins-workspace/kudu-workspace/src/kudu/tserver/tablet_server_main.cc:58:3 (kudu-tserver+0x0000004abcec)
#9 main /data1/jenkins-workspace/kudu-workspace/src/kudu/tserver/tablet_server_main.cc:72:10 (kudu-tserver+0x0000004abace)
Previous read of size 8 at 0x7d480000bca0 by thread T118:
#0 std::_Rb_tree<std::string, std::pair<std::string const, kudu::Webserver::PathHandler*>, std::_Select1st<std::pair<std::string const, kudu::Webserver::PathHandler*> >, std::less<std::string>, std::allocator<std::pair<std::string const, kudu::Webserver::PathHandler*> > >::begin() /data1/jenkins-workspace/kudu-workspace/thirdparty/installed-deps-tsan/gcc/include/c++/4.9.3/bits/stl_tree.h:729:29 (libserver_process.so+0x00000008d14a)
#1 std::map<std::string, kudu::Webserver::PathHandler*, std::less<std::string>, std::allocator<std::pair<std::string const, kudu::Webserver::PathHandler*> > >::begin() /data1/jenkins-workspace/kudu-workspace/thirdparty/installed-deps-tsan/gcc/include/c++/4.9.3/bits/stl_map.h:356:16 (libserver_process.so+0x000000089569)
#2 kudu::Webserver::BootstrapPageHeader(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >*) /data1/jenkins-workspace/kudu-workspace/src/kudu/server/webserver.cc:419:50 (libserver_process.so+0x000000088c44)
#3 kudu::Webserver::RunPathHandler(kudu::Webserver::PathHandler const&, sq_connection*, sq_request_info*) /data1/jenkins-workspace/kudu-workspace/src/kudu/server/webserver.cc:354:18 (libserver_process.so+0x000000088967)
#4 kudu::Webserver::BeginRequestCallback(sq_connection*, sq_request_info*) /data1/jenkins-workspace/kudu-workspace/src/kudu/server/webserver.cc:300:10 (libserver_process.so+0x00000008863b)
#5 kudu::Webserver::BeginRequestCallbackStatic(sq_connection*) /data1/jenkins-workspace/kudu-workspace/src/kudu/server/webserver.cc:275:10 (libserver_process.so+0x0000000881f5)
#6 handle_request /data1/jenkins-workspace/kudu-workspace/thirdparty/squeasel-8ac777a122fccf0358cb8562e900f8e9edd9ed11/squeasel.c:3994 (libserver_process.so+0x00000009c3ad)
Change-Id: Ie0381d2cbb90761491a57df16b6db7dc37ca4ba0
---
M src/kudu/server/webserver.cc
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/81/1981/1
--
To view, visit http://gerrit.cloudera.org:8080/1981
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0381d2cbb90761491a57df16b6db7dc37ca4ba0
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>