]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connections/deinit: destroy the idle_conns tasks
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:53:07 +0000 (18:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:54:08 +0000 (18:54 +0200)
This adds a deinit_idle_conns() function that's called on deinit to
release the per-thread idle connection management tasks. The global
task was already taken care of.

src/connection.c

index d37ad76d96f57db07db7a47931cb3140f4f7f3f5..abe4fd66e4e5112efb0510f3de92aa0a9f917dbc 100644 (file)
@@ -2437,3 +2437,14 @@ static int deallocate_mux_cleanup(void)
        return 1;
 }
 REGISTER_PER_THREAD_FREE(deallocate_mux_cleanup);
+
+static void deinit_idle_conns(void)
+{
+       int i;
+
+       for (i = 0; i < global.nbthread; i++) {
+               if (idle_conns[i].cleanup_task)
+                       task_destroy(idle_conns[i].cleanup_task);
+       }
+}
+REGISTER_POST_DEINIT(deinit_idle_conns);