]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Rework] Add CFG_REF_* macros with debug logging for config refcounting
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 28 Oct 2025 14:23:10 +0000 (14:23 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 28 Oct 2025 14:23:10 +0000 (14:23 +0000)
commita874072aa9a50739f49b49c343b49e18f8d74a8e
treec98f49cb95d3866845373ba6a5fedea9a247040b
parentf4a6b3bb6673ed8d56b9db85c97bf4bc0d2c11dd
[Rework] Add CFG_REF_* macros with debug logging for config refcounting

Introduce specialized refcount macros for rspamd_config that provide
debug-level logging for better debugging of configuration lifecycle:

- CFG_REF_INIT_RETAIN: Initialize refcount to 1
- CFG_REF_RETAIN: Increment refcount
- CFG_REF_RELEASE: Decrement refcount and destroy if reaches 0

These macros use G_LOG_LEVEL_DEBUG to avoid cluttering info logs
with refcounting details, while still providing visibility when
debugging config lifetime issues.

Also update all workers and components to use the new CFG_REF_* macros
instead of generic REF_* macros for better tracking.
13 files changed:
src/controller.c
src/fuzzy_storage.c
src/hs_helper.c
src/libcryptobox/cryptobox.c
src/libserver/cfg_file.h
src/libserver/cfg_rcl.cxx
src/libserver/rspamd_control.c
src/libserver/task.c
src/rspamadm/configtest.c
src/rspamadm/rspamadm.c
src/rspamd_proxy.c
src/worker.c
test/rspamd_upstream_test.c