Software / code / prosody
Comparison
plugins/mod_smacks.lua @ 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 |
| parent | 12850:101c758428aa |
| child | 13022:a313b7260145 |
comparison
equal
deleted
inserted
replaced
| 12923:419e55abd285 | 13021:14ca500f8621 |
|---|---|
| 472 return | 472 return |
| 473 end | 473 end |
| 474 if session.hibernating then return end | 474 if session.hibernating then return end |
| 475 | 475 |
| 476 session.hibernating = os_time(); | 476 session.hibernating = os_time(); |
| 477 session.hibernating_watchdog = watchdog.new(resume_timeout, function() | 477 session.hibernating_watchdog = watchdog.new(resume_timeout, function(this_dog) |
| 478 if this_dog ~= session.hibernating_watchdog then | |
| 479 -- This really shouldn't happen? | |
| 480 session.log("debug", "Releasing a stray watchdog"); | |
| 481 return | |
| 482 end | |
| 478 session.log("debug", "mod_smacks hibernation timeout reached..."); | 483 session.log("debug", "mod_smacks hibernation timeout reached..."); |
| 479 if session.destroyed then | 484 if session.destroyed then |
| 480 session.log("debug", "The session has already been destroyed"); | 485 session.log("debug", "The session has already been destroyed"); |
| 481 return | 486 return |
| 482 elseif not session.resumption_token then | 487 elseif not session.resumption_token then |