Software /
code /
prosody
Changeset
13021:14ca500f8621 0.12
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 02 Apr 2023 10:37:44 +0200 |
parents | 12923:419e55abd285 |
children | 13022:a313b7260145 |
files | plugins/mod_smacks.lua |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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");