aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-04-02 10:37:44 +0200
committerKim Alvefur <zash@zash.se>2023-04-02 10:37:44 +0200
commit3a3d9c6c2c425998e2edf5d1d9f910f25ee39af4 (patch)
tree7ab37491ec62f7a5901750239ffed16cc870107e /plugins
parent0890b20fbff4bff4c557d79ec53f36016085da82 (diff)
downloadprosody-3a3d9c6c2c425998e2edf5d1d9f910f25ee39af4.tar.gz
prosody-3a3d9c6c2c425998e2edf5d1d9f910f25ee39af4.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_smacks.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index a4ff0444..756e2d9a 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -474,7 +474,12 @@ module:hook("pre-resource-unbind", function (event)
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");