Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Conversation

@chrislmar
Copy link

Close file descriptors (FDs) for the pipes between the MultipleCmd
parent and its children to prevent the parent from exceeding the default
per-process Linux limit of 1024 FDs.

The pipes created for communication between the parent process and each
subprocess are unidirectional. Close the unused ends of the pipes in the
parent and child as soon as a child is spawned.

In the parent, keep track of the other FDs for each subprocesses, and
close the FDs for a subproccess when it's reaped.

MultipleCmd now requires only (3 * maxflight) open FDs instead of
(6 * total number of commands). Given a per-process FD limit of 1024,
the theoretical limit for maxflight is 341, versus the previous limit of
170.

Close file descriptors (FDs) for the pipes between the MultipleCmd
parent and its children to prevent the parent from exceeding the default
per-process Linux limit of 1024 FDs.

The pipes created for communication between the parent process and each
subprocess are unidirectional. Close the unused ends of the pipes in the
parent and child as soon as a child is spawned.

In the parent, keep track of the other FDs for each subprocesses, and
close the FDs for a subproccess when it's reaped.

MultipleCmd now requires only (3 * maxflight) open FDs instead of
(6 * total number of commands). Given a per-process FD limit of 1024,
the theoretical limit for maxflight is 341, versus the previous limit of
170.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant