Hello Alexey Serbin, Kudu Jenkins, Adar Dembo,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15069

to look at the new patch set (#2).

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
---
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(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/69/15069/2
--
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: newpatchset
Gerrit-Change-Id: I184a01be3e1ac7f60a8b3aedab176dc9138033e0
Gerrit-Change-Number: 15069
Gerrit-PatchSet: 2
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to