]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg: fix deadlock when handling existing but closed v2 connection 47930/head
authorRadosław Zarzyński <rzarzyns@redhat.com>
Fri, 17 Jun 2022 12:17:25 +0000 (14:17 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 2 Sep 2022 16:48:29 +0000 (16:48 +0000)
commit052dac980b1d22aa75935fe7c92c6a6a856a1417
tree5f149ffc8bb6aec996e68b5bc176d1bebe48c67d
parenta326c5c4a443f71f286dcfafb1faaa8abdd1c29a
msg: fix deadlock when handling existing but closed v2 connection

The deadlock is illustrated best by the following snippet
provided by jianwei zhang who also made the problem analysis
(many thanks!).

```
thread-35
AsyncMessenger::shutdown_connections         hold             AsyncMessenger::lock            std::lock_guard l{lock}
AsyncConnection::stop                         wait                AsyncConnection::lock            lock.lock()

thread-3
ProtocolV2::handle_existing_connection        hold                AsyncConnection::lock            std::lock_guard<std::mutex> l(existing->lock)
AsyncMessenger::accept_conn                wait                AsyncMessenger::lock            std::lock_guard l{lock}
```

Fixes: https://tracker.ceph.com/issues/55355
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
(cherry picked from commit a6fcb1ccbc44e60416eb5f4e2c7291afe3a9d44d)
src/msg/async/ProtocolV2.cc