Andrew Wong has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/15069 )
Change subject: mini-cluster: disallow restarting daemons from other threads
......................................................................
mini-cluster: disallow restarting daemons from other threads
If we restart an external daemon from a separate thread, the daemon can be
killed silently and without warning when the thread is reaped.
For instance, the following would fail without logging any information about
the tserver dying:
TEST_F(ExternalMiniClusterITestBase, TestRestartFromThread) {
ExternalMiniClusterOptions opts;
opts.num_tablet_servers = 1;
NO_FATALS(StartClusterWithOpts(std::move(opts)));
thread t([&] {
auto* ts = cluster_->tablet_server(0);
ts->Shutdown();
return ts->Restart();
});
t.join();
SleepFor(MonoDelta::FromSeconds(1));
ASSERT_TRUE(cluster_->tablet_server(0)->IsProcessAlive());
}
I didn't add a death test, since death tests themselves don't work well in
multithreaded contexts.
Change-Id: I184a01be3e1ac7f60a8b3aedab176dc9138033e0
Reviewed-on: http://gerrit.cloudera.org:8080/15069
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
---
M src/kudu/mini-cluster/external_mini_cluster.cc
M src/kudu/mini-cluster/external_mini_cluster.h
2 files changed, 14 insertions(+), 2 deletions(-)
Approvals:
Kudu Jenkins: Verified
Alexey Serbin: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/15069
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I184a01be3e1ac7f60a8b3aedab176dc9138033e0
Gerrit-Change-Number: 15069
Gerrit-PatchSet: 3
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)