From 14a7fdb2a84dcc7ba07c54ae3613c11f91da4720 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 11 Feb 2022 21:41:04 +0100 Subject: mod_s2s: Disable creation of new outgoing connections during shutdown --- plugins/mod_s2s.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index 1b40f782..4b721237 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -964,6 +964,13 @@ module:hook("server-stopping", function(event) pm.unregister_service(netservice.name, netservice); end + -- Stop opening new connections + for host in pairs(prosody.hosts) do + if prosody.hosts[host].modules.s2s then + module:context(host):unhook("route/remote", route_to_new_session); + end + end + -- Close sessions local reason = event.reason; for _, session in pairs(sessions) do -- cgit v1.2.3