]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: updating l_msgr_running_send_time if write_message failed.
authorJianpeng Ma <jianpeng.ma@intel.com>
Wed, 25 Oct 2017 16:50:29 +0000 (00:50 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Wed, 25 Oct 2017 16:50:29 +0000 (00:50 +0800)
Also for the most time write_message return zero. So avoid checking
"r < 0 or r > 0" every time, it should firstly check "r == 0".

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/msg/async/AsyncConnection.cc

index 30eec2f3f30a4ff85e0578ef4527bf5693962b68..37b77807e772af86f2dc6cc5725ebc74a62d6ca6 100644 (file)
@@ -2402,13 +2402,15 @@ void AsyncConnection::handle_write()
         prepare_send_message(get_features(), m, data);
 
       r = write_message(m, data, more);
-      if (r < 0) {
-        ldout(async_msgr->cct, 1) << __func__ << " send msg failed" << dendl;
-        goto fail;
-      }
+
       write_lock.lock();
-      if (r > 0)
-        break;
+      if (r == 0) {
+       ;
+      } else if (r < 0) {
+       ldout(async_msgr->cct, 1) << __func__ << " send msg failed" << dendl;
+       break;
+      } else if (r > 0)
+       break;
     } while (can_write == WriteStatus::CANWRITE);
     write_lock.unlock();