From: Haomai Wang Date: Wed, 8 Jul 2015 03:32:29 +0000 (+0800) Subject: AsyncConnection: Only prepare message when it support fast dispatch X-Git-Tag: v9.0.3~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5166%2Fhead;p=ceph.git AsyncConnection: Only prepare message when it support fast dispatch Not all messages support reencode now, we just avoid them prepare firstly when call "send_message" Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index a142e5848025..bb47b3ea3ae2 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1939,7 +1939,10 @@ int AsyncConnection::send_message(Message *m) if (!m->get_priority()) m->set_priority(async_msgr->get_default_send_priority()); - prepare_send_message(f, m, bl); + // 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)) + prepare_send_message(f, m, bl); Mutex::Locker l(write_lock); // "features" changes will change the payload encoding