]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/Pipe: do not wait for self in Pipe::stop_and_wait() 2238/head
authorSage Weil <sage@redhat.com>
Mon, 11 Aug 2014 03:22:23 +0000 (20:22 -0700)
committerSage Weil <sage@redhat.com>
Mon, 11 Aug 2014 03:22:23 +0000 (20:22 -0700)
commit8180713c1086fb4ad42019cd885ed01ecca52132
tree90c9eee0bd2649546d40f0cb599e478060a2fde3
parent84c96547049bd0b780e1f84653c9c2a60b5a46c2
msg/Pipe: do not wait for self in Pipe::stop_and_wait()

The fast dispatch code necessitated adding a wait for the fast dispatch
to complete when taking over sockets back in commit
2d5d3097c3998add1061ce253104154d72879237.  This included mark_down()
(although I am not certain mark_down was required to fix the previous set
of races).

In any case, if the fast dispatch thread itself tries to mark down its
own connection, it will deadlock in this method waiting for itself to
return and clear reader_dispatching.  Skip this wait if we are in fact
the reader thread.  This avoids the deadlock.

Alternatively, we could change mark_down() to not use stop_and_wait(), but
I am less clear about the potential races there, so I'm opting for the
minimal (though ugly) fix.

Fixes: #9057
Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Pipe.cc