Mercurial > prosody-hg
diff plugins/mod_debug_reset.lua @ 14114:8f50e7e43df4 13.0
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.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 27 Mar 2026 12:45:38 +0000 |
| parents | 8ad432953300 |
| children | 368df9b2d511 |
line wrap: on
line diff
--- 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");
