From: Jianpeng Ma Date: Tue, 11 Jun 2019 07:21:39 +0000 (+0800) Subject: test/fio/fio_ceph_messenger: make exec multi client on the same host. X-Git-Tag: v15.1.0~2465^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28464%2Fhead;p=ceph.git test/fio/fio_ceph_messenger: make exec multi client on the same host. When create Messenger, for client we should give different nonce to make multi clients on the same host can work. Otherwise, server only accept one connection. Signed-off-by: Jianpeng Ma --- diff --git a/src/test/fio/fio_ceph_messenger.cc b/src/test/fio/fio_ceph_messenger.cc index 7b1984694fb0..49c8e12e0c12 100644 --- a/src/test/fio/fio_ceph_messenger.cc +++ b/src/test/fio/fio_ceph_messenger.cc @@ -300,8 +300,10 @@ static Messenger *create_messenger(struct ceph_msgr_options *o) ceph_msgr_types[o->ms_type] : g_ceph_context->_conf.get_val("ms_type"); + /* o->td__>pid doesn't set value, so use getpid() instead*/ + auto nonce = o->is_receiver ? 0 : (getpid() + o->td__->thread_number); Messenger *msgr = Messenger::create(g_ceph_context, ms_type.c_str(), - ename, lname, 0, flags); + ename, lname, nonce, flags); if (o->is_receiver) { msgr->set_default_policy(Messenger::Policy::stateless_server(0)); msgr->bind(hostname_to_addr(o)); @@ -385,6 +387,7 @@ static void put_messenger(struct ceph_msgr_data *data) static int fio_ceph_msgr_setup(struct thread_data *td) { struct ceph_msgr_options *o = (decltype(o))td->eo; + o->td__ = td; ceph_msgr_data *data; /* We have to manage global resources so we use threads */