]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #2825 from ceph/wip-9921
authorSage Weil <sage@redhat.com>
Mon, 1 Dec 2014 17:23:39 +0000 (09:23 -0800)
committerSage Weil <sage@redhat.com>
Mon, 1 Dec 2014 17:23:39 +0000 (09:23 -0800)
SimpleMessenger: Pipe: do not block on takeover while holding global locks

Reviewed-by: Sage Weil <sage@redhat.com>
1  2 
src/msg/simple/Pipe.cc

index df503dc0113795b3218c7f6ac808039e2f2c6552,32c144fb79bcefe54f5af60c142c47cf26fb3b4c..ef49a86e394380bfd5acb0a636c712affea1d1cf
@@@ -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();
    }