From: Haomai Wang Date: Tue, 14 Jul 2015 17:44:14 +0000 (+0800) Subject: AsyncConnection: Fix non-fastdispatch message doesn't prepare case X-Git-Tag: v9.0.3~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bbe98a1ef8c2dc7baa39a79f75eddd175507ec1;p=ceph.git AsyncConnection: Fix non-fastdispatch message doesn't prepare case Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index bb47b3ea3ae2..bc1b803a1766 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1941,7 +1941,8 @@ int AsyncConnection::send_message(Message *m) // TODO: Currently not all messages supports reencode like MOSDMap, so here // only let fast dispatch support messages prepare message - if (async_msgr->ms_can_fast_dispatch(m)) + bool can_fast_prepare = async_msgr->ms_can_fast_dispatch(m); + if (can_fast_prepare) prepare_send_message(f, m, bl); Mutex::Locker l(write_lock); @@ -1954,6 +1955,8 @@ int AsyncConnection::send_message(Message *m) << f << " != " << get_features() << dendl; } if (!is_queued() && can_write == CANWRITE) { + if (!can_fast_prepare) + prepare_send_message(f, m, bl); if (write_message(m, bl) < 0) { ldout(async_msgr->cct, 1) << __func__ << " send msg failed" << dendl; // we want to handle fault within internal thread