apt-cacher has poor childpid management
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt-cacher (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Apt-cacher keeps a list of the pids of any children it forks/spawns. At shutdown, it terminates them all with SIGTERM. Unfortunately, it doesn't catch SIGCHLD and remove a normal finished child from the list. So after it's been running for a while, that list of PIDs will be fairly long and rather comprehensive (on one recent server where I noticed it, the list had 25000 unique PIDs, i.e. about 3/4s of the available PID space :)).
The only mitigating factor is that apt-cacher runs as www-data by default, although that doesn't help if you're running it on the same server as apache2, nginx or some other www-data running process.
Patch attached fixes this; it uses a hash instead of an array, and traps SIGCHLD to catch when children finish. Seems to work ok in a short time running it here.
The attachment "Patch to fix the problem" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.
[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]