]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common: fix md_config_cacher_t
authorRonen Friedman <rfriedma@redhat.com>
Thu, 9 Jan 2025 17:06:37 +0000 (11:06 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 15 Jan 2025 14:00:22 +0000 (08:00 -0600)
commit2dfa89e24364138776a75ea469c29702f53c0a7a
tree73787a2ca7c572e360b74ce3fc290124a57055ce
parentc58f72ab631c4c57827ea5600ae78f1379c37bfb
common: fix md_config_cacher_t

In its get_tracked_conf_keys() member function, the
cacher (in the existing code) initializes a static
function-block variable ('keys'), and uses it for
registering the observer.

But the cacher is instantiated on the type of
the configuration value. Thus, multiple cacher
objects for which the configuration values are
of the same type - share the static 'keys'. Only
one of the observers is registered.

Note that the code could have been simplified
somewhat, if the signature of the
get_tracked_conf_keys() function
was changed to return 'const char* const *'.

Fixes (original PR): https://tracker.ceph.com/issues/69236
Fixes: https://tracker.ceph.com/issues/69530
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit 8ac04704574671e72de6f3ba30c1c3baa39a6319)
src/common/config_cacher.h