changeset 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 b9688ac25255
children 44a8c8d4146a 519c16c2eb21
files plugins/mod_debug_reset.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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");