From: Jianpeng Ma Date: Wed, 25 Oct 2017 16:50:29 +0000 (+0800) Subject: msg/async: updating l_msgr_running_send_time if write_message failed. X-Git-Tag: v13.0.1~412^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1a6817a507864c92579f3e90f2cb3b19f6e7ee94;p=ceph.git msg/async: updating l_msgr_running_send_time if write_message failed. 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 --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 30eec2f3f30a..37b77807e772 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -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();