From: Sage Weil Date: Mon, 1 Dec 2014 17:23:39 +0000 (-0800) Subject: Merge pull request #2825 from ceph/wip-9921 X-Git-Tag: v0.90~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f868ca04d2ee57b214837d824653e3a2d56e23da;p=ceph.git Merge pull request #2825 from ceph/wip-9921 SimpleMessenger: Pipe: do not block on takeover while holding global locks Reviewed-by: Sage Weil --- f868ca04d2ee57b214837d824653e3a2d56e23da diff --cc src/msg/simple/Pipe.cc index df503dc01137,32c144fb79bc..ef49a86e3943 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@@ -1429,7 -1446,22 +1445,16 @@@ void Pipe::stop_and_wait( { if (state != STATE_CLOSED) stop(); + + if (msgr->cct->_conf->ms_inject_internal_delays) { + ldout(msgr->cct, 10) << __func__ << " sleep for " + << msgr->cct->_conf->ms_inject_internal_delays + << dendl; + utime_t t; + t.set_from_double(msgr->cct->_conf->ms_inject_internal_delays); + t.sleep(); + } - // HACK: we work around an annoying deadlock here. If the fast - // dispatch method calls mark_down() on itself, it can block here - // waiting for the reader_dispatching flag to clear... which will - // clearly never happen. Avoid the situation by skipping the wait - // if we are marking our *own* connect down. Do the same for the - // delayed dispatch thread. if (delay_thread) { delay_thread->stop_fast_dispatching(); }