Bug #20757
DAQInterface appears to leak file descriptors
100%
Description
From Eric:
"DAQInterface appears to leak file descriptors (possibly handles to per-run log files?)...I did 297 runs in one instance, and it failed to boot after due to a "too many open files" error. "
Associated revisions
History
#1 Updated by John Freeman over 2 years ago
- Assignee set to John Freeman
#2 Updated by Eric Flumerfelt over 2 years ago
- File daqinterface_lsof.log daqinterface_lsof.log added
- File daqinterface_fds.log daqinterface_fds.log added
I made another long-running instance, and there's a large number of PIPEs, apparently between two threads within DAQInterface. I have captured the output of lsof into a log file, as well as the output of ls -l /proc/<PID>/fd.
#3 Updated by Eric Flumerfelt over 2 years ago
After a bit more testing, it appears that the leak happens on Terminate-Boot cycles, not Stop-Start cycles.
#4 Updated by John Freeman over 2 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Solved with commit e05a76e400de3ba1382f8424c9cf2f333179d717. I'll just quote the commit comments:
JCF: The cut-and-pasted deepsuppression context manager I got from stackoverflow.com back in 2014 had
a bug, in that it wasn't closing all file descriptors in deepsuppression.__exit__. Whenever deepsuppression() was called by DAQInterface, it was leaking file descriptors, a problem observed by Eric in Issue #20757. This commit properly closes the file
descriptors.
JCF: The cut-and-pasted deepsuppression context manager I got from
stackoverflow.com back in 2014 had a bug, in that it wasn't closing
all file descriptors in exit. Whenever it was called by
DAQInterface, it was leaking file descriptors, a problem observed by
Eric in Issue #20757. This commit properly closes the file
descriptors.