diff --git a/src/flow-manager.c b/src/flow-manager.c index d175f02bb4..bea4b6b351 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -769,6 +769,8 @@ void FlowKillFlowRecyclerThread(void) TmThreadsSetFlag(tv, THV_KILL); TmThreadsSetFlag(tv, THV_DEINIT); + SCCtrlCondSignal(&flow_recycler_ctrl_cond); + /* be sure it has shut down */ while (!TmThreadsCheckFlag(tv, THV_CLOSED)) { usleep(100); diff --git a/src/suricata.c b/src/suricata.c index ebbea361f2..9be6671abd 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2402,11 +2402,16 @@ int main(int argc, char **argv) BUG_ON(global_de_ctx == NULL); } + /* before TmThreadKillThreads, as otherwise that kills it + * but more slowly */ + if (suri.run_mode != RUNMODE_UNIX_SOCKET) { + FlowKillFlowRecyclerThread(); + } + TmThreadKillThreads(); if (suri.run_mode != RUNMODE_UNIX_SOCKET) { SCPerfReleaseResources(); - FlowKillFlowRecyclerThread(); FlowShutdown(); StreamTcpFreeConfig(STREAM_VERBOSE); }