mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 22:03:12 +00:00
lib: zlog stays running on shutdown
No `zlog_fini()`, please. Getting log messages until the end is more important than leaking memory allocated for zlog targets. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
b7420c46de
commit
e95fbc1d8c
16
lib/libfrr.c
16
lib/libfrr.c
@ -1269,7 +1269,21 @@ void frr_fini(void)
|
|||||||
event_master_free(master);
|
event_master_free(master);
|
||||||
master = NULL;
|
master = NULL;
|
||||||
zlog_tls_buffer_fini();
|
zlog_tls_buffer_fini();
|
||||||
zlog_fini();
|
|
||||||
|
if (0) {
|
||||||
|
/* this is intentionally disabled. zlog remains running until
|
||||||
|
* exit(), so even the very last item done during shutdown can
|
||||||
|
* have its zlog() messages written out.
|
||||||
|
*
|
||||||
|
* Yes this causes memory leaks. They are explicitly marked
|
||||||
|
* with DEFINE_MGROUP_ACTIVEATEXIT, which is only used for
|
||||||
|
* log target memory allocations, and excluded from leak
|
||||||
|
* reporting at shutdown. This is strongly preferable over
|
||||||
|
* just discarding error messages at shutdown.
|
||||||
|
*/
|
||||||
|
zlog_fini();
|
||||||
|
}
|
||||||
|
|
||||||
/* frrmod_init -> nothing needed / hooks */
|
/* frrmod_init -> nothing needed / hooks */
|
||||||
rcu_shutdown();
|
rcu_shutdown();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user