You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2017/06/12 21:26:03 UTC

[kudu-CR] mini cluster: shutdown in destructors

Hello Mike Percy, Kudu Jenkins,

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

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

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

Change subject: mini_cluster: shutdown in destructors
......................................................................

mini_cluster: shutdown in destructors

The CHECK in the MiniMaster destructor isn't safe; it can fire during test
setup before the master has been shut down. For example, consider this
(edited) code snippet from MiniCluster::StartSingleMaster():

  gscoped_ptr<MiniMaster> mini_master(new MiniMaster(...));
  RETURN_NOT_OK(mini_master->Start());
  RETURN_NOT_OK(mini_master->master()->WaitForSomething(...));
  mini_masters_.push_back(shared_ptr<MiniMaster>(mini_master.release()));

MiniCluster's destructor guarantees that the masters are shut down before
being destroyed, but if WaitForSomething() fails, the new master won't be
added to mini_masters_ and thus will be destroyed without first being shut
down at the end of StartSingleMaster(). To make this safe, let's remove the
CHECK and shut down the master in the destructor. I rolled this out to
MiniTabletServer too, for consistency.

The CHECK (and timeout in StartSingleMaster()) is the cause of one source of
flakiness in delete_tablet-itest.

Change-Id: I742e190f751535d2a59354c3b35cdaf0a340d4ea
---
M src/kudu/integration-tests/mini_cluster.cc
M src/kudu/master/mini_master.cc
M src/kudu/tserver/mini_tablet_server.cc
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/51/7151/2
-- 
To view, visit http://gerrit.cloudera.org:8080/7151
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I742e190f751535d2a59354c3b35cdaf0a340d4ea
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>