From d2d41bc34e1663803037fc0a6c7bda9078cef2b6 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Fri, 28 Jun 2024 15:12:11 -0700 Subject: session: memory leaks on various transports when session disable and enable When toggling session disable and enable, memory leaks found on various transports. Don't create the timer wheels on enable when they are already creaded. Don't create the spin locks when they are already created. Add session enable disable test in session unit test. Type: fix Change-Id: I08988a96bbf2d67a67c743b50b63f5b1e27402a3 Signed-off-by: Steven Luong --- src/plugins/http/http_timer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/http/http_timer.c') diff --git a/src/plugins/http/http_timer.c b/src/plugins/http/http_timer.c index 42fe69076fe..c8fc6328855 100644 --- a/src/plugins/http/http_timer.c +++ b/src/plugins/http/http_timer.c @@ -71,6 +71,8 @@ http_timers_init (vlib_main_t *vm, http_conn_timeout_fn *cb_fn) http_tw_ctx_t *twc = &http_tw_ctx; vlib_node_t *n; + if (twc->tw.timers) + return; tw_timer_wheel_init_2t_1w_2048sl (&twc->tw, http_timer_process_expired_cb, 1.0 /* timer interval */, ~0); clib_spinlock_init (&twc->tw_lock); -- cgit 1.2.3-korg