# HG changeset patch # User Kim Alvefur # Date 1680424664 -7200 # Node ID 14ca500f8621f16950ec4a19d35bc66befa81799 # Parent 419e55abd28590d2b3eeb0cfa8944205a1e01dcd mod_smacks: Fix stray watchdog closing sessions Unsure exactly how this happens, but sometimes a watchdog appears to close a session that isn't hibernating, or hasn't hibernating long enough. diff -r 419e55abd285 -r 14ca500f8621 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Sun Mar 05 15:45:01 2023 +0100 +++ b/plugins/mod_smacks.lua Sun Apr 02 10:37:44 2023 +0200 @@ -474,7 +474,12 @@ if session.hibernating then return end session.hibernating = os_time(); - session.hibernating_watchdog = watchdog.new(resume_timeout, function() + session.hibernating_watchdog = watchdog.new(resume_timeout, function(this_dog) + if this_dog ~= session.hibernating_watchdog then + -- This really shouldn't happen? + session.log("debug", "Releasing a stray watchdog"); + return + end session.log("debug", "mod_smacks hibernation timeout reached..."); if session.destroyed then session.log("debug", "The session has already been destroyed");