From: Song Shun Date: Mon, 17 Aug 2020 00:40:21 +0000 (+0800) Subject: osdc: fix lingerOp stray X-Git-Tag: v16.1.0~1376^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65d05fdd579d21dd57b72b1d9148380bc6074269;p=ceph.git osdc: fix lingerOp stray when linger ping failed with error, like ENOTCONN last_error set to error. after that, last_error will never recovery to succecss(0), even reconnecting successfully, which stops from sending linger ping to osd. as a result, this normal client ** can't receive notify message ** after osd_client_watch_timeout goes away. Fixes: https://tracker.ceph.com/issues/47004 Signed-off-by: Song Shun --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 816d358ad12c9..8a87ec5892db9 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -653,17 +653,17 @@ void Objecter::_linger_reconnect(LingerOp *info, bs::error_code ec) { ldout(cct, 10) << __func__ << " " << info->linger_id << " = " << ec << " (last_error " << info->last_error << ")" << dendl; + std::unique_lock wl(info->watch_lock); if (ec) { - std::unique_lock wl(info->watch_lock); if (!info->last_error) { ec = _normalize_watch_error(ec); - info->last_error = ec; if (info->handle) { boost::asio::defer(finish_strand, CB_DoWatchError(this, info, ec)); } } - wl.unlock(); } + + info->last_error = ec; } void Objecter::_send_linger_ping(LingerOp *info)