Project

General

Profile

Bug #20757

DAQInterface appears to leak file descriptors

Added by John Freeman about 1 year ago. Updated 12 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
09/06/2018
Due date:
% Done:

100%

Estimated time:
Experiment:
-
Co-Assignees:
Duration:

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. "

daqinterface_lsof.log (237 KB) daqinterface_lsof.log Eric Flumerfelt, 09/07/2018 07:41 AM
daqinterface_fds.log (58.1 KB) daqinterface_fds.log Eric Flumerfelt, 09/07/2018 07:42 AM

Associated revisions

Revision e05a76e4 (diff)
Added by John Freeman 12 months ago

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.

History

#1 Updated by John Freeman about 1 year ago

  • Assignee set to John Freeman

#2 Updated by Eric Flumerfelt about 1 year ago

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 about 1 year 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 12 months 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.



Also available in: Atom PDF