What steps will reproduce the problem?
1. Let Prosody do DNS requests.
What is the expected output?
Prosody does the DNS requests, and work forever.
What do you see instead?
Prosody runs out of fds, keeping all of the UDP sockets to my resolver open.
What version of the product are you using? On what operating system?
Trunk version 0bb46a1bb398, on ArchLinux.
Please provide any additional information below.
This didn’t seem to be happening on a version a few months older.
Zash
on
Thanks for the report. This is most likely because net.server holds on to all sockets until they are explicitly closed.
Changes
tags Status-Accepted Milestone-0.10
Zash
on
diff -r 144666d0ad2f -r c46c2942b8fe plugins/mod_s2s/mod_s2s.lua
--- a/plugins/mod_s2s/mod_s2s.lua Sun Jun 10 17:45:49 2018 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua Sun Jun 17 20:02:40 2018 +0200
@@ -206,6 +206,9 @@ function mark_connected(session)
session.sendq = nil;
end
+ if session.resolver then
+ session.resolver._resolver:closeall()
+ end
session.resolver = nil;
session.ip_hosts = nil;
session.srv_hosts = nil;
Changes
owner Zash
tags Patch Status-Started
Zash
on
I'm wondering if a session that is destroyed before reaching the above will leak the session (until the read-timeout).
Zash
on
Pushed the above patch as https://hg.prosody.im/0.10/rev/c46c2942b8fe
While this probably takes care of the majority of cases, I'm not centain that it is a complete fix. Need to investigate what happens if a session fails to connect.
Changes
tagsPatch Status-NeedInfo
Zash
on
Assuming that fixed it.
Changes
tags Status-Fixed
Zash
on
Switching to the new net.connect API for s2s has resulted in a regression of this issue, see #1429
What steps will reproduce the problem? 1. Let Prosody do DNS requests. What is the expected output? Prosody does the DNS requests, and work forever. What do you see instead? Prosody runs out of fds, keeping all of the UDP sockets to my resolver open. What version of the product are you using? On what operating system? Trunk version 0bb46a1bb398, on ArchLinux. Please provide any additional information below. This didn’t seem to be happening on a version a few months older.
Thanks for the report. This is most likely because net.server holds on to all sockets until they are explicitly closed.
Changesdiff -r 144666d0ad2f -r c46c2942b8fe plugins/mod_s2s/mod_s2s.lua --- a/plugins/mod_s2s/mod_s2s.lua Sun Jun 10 17:45:49 2018 +0200 +++ b/plugins/mod_s2s/mod_s2s.lua Sun Jun 17 20:02:40 2018 +0200 @@ -206,6 +206,9 @@ function mark_connected(session) session.sendq = nil; end + if session.resolver then + session.resolver._resolver:closeall() + end session.resolver = nil; session.ip_hosts = nil; session.srv_hosts = nil;
ChangesI'm wondering if a session that is destroyed before reaching the above will leak the session (until the read-timeout).
Pushed the above patch as https://hg.prosody.im/0.10/rev/c46c2942b8fe While this probably takes care of the majority of cases, I'm not centain that it is a complete fix. Need to investigate what happens if a session fails to connect.
ChangesPatchStatus-NeedInfoAssuming that fixed it.
ChangesSwitching to the new net.connect API for s2s has resulted in a regression of this issue, see #1429