#60 Use procfs if available, to speed discovery of open file descriptors
Closed: Fixed a year ago by bignose. Opened 2 years ago by bignose.

As discussed in issue #40, there is no portable way to discover only open file descriptors. Currently, the discovery of candidate file descriptors results in many candidates, which leads to a significant time to attempt closing them all on daemon start-up.

On Linux (only), the “procfs” kernel feature allows querying the process's open files directly. This can make the set of candidate file descriptors to close much smaller, and will speed up daemon start time, only on those platforms which have this feature.


Thank you @apyrgio for suggesting to use this means to discover open file descriptors.

I think we have a different way to avoid the costly computation, which uses a platform-agnostic implementation.

Could you test the changes introduced in commit 297e91a (now part of the 'main' branch)? That uses an alternative implementation of _get_candidate_file_descriptor_ranges which does not allocate the set of possible file descriptors.

Could you test the changes introduced in commit 297e91a (now part of the 'main' branch)? That uses an alternative implementation of _get_candidate_file_descriptor_ranges which does not allocate the set of possible file descriptors.

The implementation is now part of the 'python-daemon' version 3.0.1 release.

I believe that resolves this issue; feel free to open a new issue if this problem recurs.

Metadata Update from @bignose:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

a year ago

Login to comment on this ticket.

Metadata