From: Sage Weil Date: Mon, 11 Jan 2016 14:04:29 +0000 (-0500) Subject: Merge pull request #5882 from aiicore/add_thread_names X-Git-Tag: v10.0.3~80 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6e99021921e64821f5b5ebdb13bd38680d3714e;p=ceph.git Merge pull request #5882 from aiicore/add_thread_names common: add thread names Reviewed-by: Sage Weil --- b6e99021921e64821f5b5ebdb13bd38680d3714e diff --cc src/mds/MDLog.cc index 3aea9df34e0,c8817b5eb4a..2a0c7166409 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@@ -176,11 -176,10 +176,11 @@@ void MDLog::open(MDSInternalContextBas { dout(5) << "open discovering log bounds" << dendl; + assert(!recovery_thread.is_started()); recovery_thread.set_completion(c); - recovery_thread.create(); + recovery_thread.create("md_recov_open"); - submit_thread.create(); + submit_thread.create("md_submit"); // either append() or replay() will follow. } @@@ -216,13 -215,8 +216,13 @@@ void MDLog::reopen(MDSInternalContextBa delete journaler; journaler = NULL; + // recovery_thread was started at some point in the past. Although + // it has called it's completion if we made it back here, it might + // still not have been cleaned up: join it. + recovery_thread.join(); + recovery_thread.set_completion(new C_ReopenComplete(this, c)); - recovery_thread.create(); + recovery_thread.create("md_recov_reopen"); } void MDLog::append() @@@ -846,14 -840,9 +846,14 @@@ void MDLog::replay(MDSInternalContextBa << " to " << journaler->get_write_pos() << dendl; assert(num_events == 0 || already_replayed); + if (already_replayed) { + // Ensure previous instance of ReplayThread is joined before + // we create another one + replay_thread.join(); + } already_replayed = true; - replay_thread.create(); + replay_thread.create("md_log_replay"); } diff --cc src/tools/rbd_nbd/rbd-nbd.cc index 8ce5787dd26,a6363d4a62c..07d7edb19c6 --- a/src/tools/rbd_nbd/rbd-nbd.cc +++ b/src/tools/rbd_nbd/rbd-nbd.cc @@@ -328,12 -260,10 +328,12 @@@ public void start() { if (!started) { + dout(10) << __func__ << ": starting" << dendl; + started = true; - reader_thread.create(); - writer_thread.create(); + reader_thread.create("rbd_reader"); + writer_thread.create("rbd_writer"); } }