]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osdc: fix lingerOp stray
authorSong Shun <song.shun3@zte.com.cn>
Mon, 17 Aug 2020 00:40:21 +0000 (08:40 +0800)
committerSong Shun <song.shun3@zte.com.cn>
Tue, 18 Aug 2020 09:13:56 +0000 (17:13 +0800)
  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 <song.shun3@zte.com.cn>
src/osdc/Objecter.cc

index 816d358ad12c9688d9925f4fedb98fa1d8611727..8a87ec5892db98edb51024d4ac5f16ec1e51939e 100644 (file)
@@ -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)