]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
msg/Messenger: use random nonce if CEPH_USE_RANDOM_NONCE or pid == 1
authorSage Weil <sage@newdream.net>
Sat, 27 Feb 2021 20:45:47 +0000 (15:45 -0500)
committerSage Weil <sage@newdream.net>
Mon, 1 Mar 2021 16:27:18 +0000 (11:27 -0500)
commitd18f60854e68d2060c1a3841299466f165f6552d
tree125a5b511feb7065da1024df0a271ceb891d845c
parenta16e46ef0589129bf990dc7dd24e5fa5c6defdbe
msg/Messenger: use random nonce if CEPH_USE_RANDOM_NONCE or pid == 1

If we are in a container, then we do not have a unique pid, and need to
use a random nonce.  We normally detect this if our pid is 1, but that
doesn't work when we have a init process--we'll (probably?) have a small
pid (in my tests, the OSDs were getting pid 7).

To be safe, also check for an environment variable set by cephadm.

This avoids problems that arise when we don't have a unique address.

Fixes: https://tracker.ceph.com/issues/49534
Signed-off-by: Sage Weil <sage@newdream.net>
src/msg/Messenger.cc