]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: drop stack singleton object of temp messenger for foreground ceph daemons 66897/head
authorDongdong Tao <tdd21151186@gmail.com>
Wed, 21 May 2025 08:48:52 +0000 (17:48 +0900)
committerDongdong Tao <tdd21151186@gmail.com>
Tue, 13 Jan 2026 02:13:51 +0000 (11:13 +0900)
commitd6591499ec89de4de0639f1559e48a211f3838c4
tree011c12651762b9767b2d669f23bf9818e4e79b4a
parent74ee69dfe205e4e6e7ece75bb4101e2976318440
common: drop stack singleton object of temp messenger for foreground ceph daemons

During the initialization, OSD needs to create a temporary messenger to read config db from the ceph-mon.
This temporary messenger will need to create async messenger threads according to the local/default value of "ms_async_op_threads" .
If this option is not specified in ceph.conf, it will by default create 3 threads, then use these threads to read config db from ceph-mon.
Those threads are associated to a stack singletion object.
Now here is the difference between OSD running in foreground and background:
a. In background mode, this singleton object will be dropped before forking the child process in function notify_pre_fork,
then the new ms_async_op_threads fetched from mon config db will be used to create later messenger threads, this is what we want.
b. In foreground mode, this singleton object will not be dropped and will be reused by all later messengers,
thus the number of threads doesn't change.

Fixes: https://tracker.ceph.com/issues/71401
Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
(cherry picked from commit 30d66ff075ca72c0c3759bfccee09302b221b25f)
src/common/ceph_context.cc
src/common/ceph_context.h
src/global/global_init.cc