# HG changeset patch # User Matthew Wild # Date 1774615538 0 # Node ID 8f50e7e43df41492cd8a030712d51fb955873c67 # Parent b9688ac25255859a656ed51192a3dbe247612088 mod_debug_reset: Trigger GC cycles to aid with cleanup This was observed to be necessary, as we use weak tables in a couple of places and data could persist across resets unless the GC runs. diff -r b9688ac25255 -r 8f50e7e43df4 plugins/mod_debug_reset.lua --- a/plugins/mod_debug_reset.lua Fri Mar 27 12:43:10 2026 +0000 +++ b/plugins/mod_debug_reset.lua Fri Mar 27 12:45:38 2026 +0000 @@ -16,6 +16,11 @@ module:fire_event("server-resetting"); for _, host in ipairs(hosts) do hostmanager.deactivate(host); + for i = 1, 4 do + -- Run a few cycles to ensure full cleanup, including + -- weak tables and finalizers + collectgarbage("collect"); + end hostmanager.activate(host); module:log("info", "Reset complete"); module:fire_event("server-reset");