From: Sage Weil Date: Fri, 25 Jan 2019 21:21:45 +0000 (-0600) Subject: msg/async: do not connect from server X-Git-Tag: v14.1.0~271^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=985ec03cf9cd09436693fbf5dbd61be118f023a7;p=ceph.git msg/async: do not connect from server We could have a fault on a server-side of a non-lossy connectoin where there is a fault and we have outgoing data queued. Since we are a server, we cannot connect; we should just go into standby and wait for the other end to reconnect, or for someone to mark us down. This fixes a failure reproduced by Messenger/MessengerTest.SyntheticInjectTest/0 where it would assert(!policy.server) in the connect code. Signed-off-by: Sage Weil --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index d6e9f1257381..b25132fb3d2e 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -661,6 +661,12 @@ CtPtr ProtocolV2::_fault() { connection->write_lock.unlock(); return nullptr; } + if (connection->policy.server) { + ldout(cct, 1) << __func__ << " server, going to standby, even though i have stuff queued" << dendl; + state = STANDBY; + connection->write_lock.unlock(); + return nullptr; + } connection->write_lock.unlock();