connectd: dev-report-fds to do file descriptor audit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-04-09 13:53:39 +09:30
parent e514a5d43c
commit cf80f0520a
4 changed files with 171 additions and 1 deletions

View File

@@ -1578,12 +1578,14 @@ class NodeFactory(object):
err_msgs = []
for i in range(len(self.nodes)):
leaks = None
# leak detection upsets VALGRIND by reading uninitialized mem.
# leak detection upsets VALGRIND by reading uninitialized mem,
# and valgrind adds extra fds.
# If it's dead, we'll catch it below.
if not self.valgrind and DEVELOPER:
try:
# This also puts leaks in log.
leaks = self.nodes[i].rpc.dev_memleak()['leaks']
self.nodes[i].rpc.dev_report_fds()
except Exception:
pass