]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg: add simplified messenger constructor
authorJosh Durgin <jdurgin@redhat.com>
Mon, 21 Sep 2015 22:20:53 +0000 (15:20 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Mon, 21 Sep 2015 22:56:13 +0000 (15:56 -0700)
commite3785b0b5fbff870adbd5f121021b671912386cf
treec2eb906b5a5fb7a60c11a5d45e24d6f2bc836008
parentfe54bd1bbe5714b2613876bce857234ede26f68a
msg: add simplified messenger constructor

Several callers create messengers using exactly the same parameters:

- reading the ms type from cct that is also passed in
- a default entity_name_t::CLIENT
- the default features

Additionally, the nonce should be randomized and not depend on
e.g. pid, as it does in several callers now. Clients running in
containers can easily have pid collisions, leading to hangs, so
randomize the nonce in this simplified constructor rather than
duplicating that logic in every caller.

Daemons have meaningful entity_name_ts, and monitors currently depend
on using 0 as a nonce, so make this simple constructer
client-specific.

Related: #13032
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/msg/Messenger.cc
src/msg/Messenger.h