apt-cacher-ng leaks file descriptors: Too many open files

Bug #572095 reported by Marti
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-cacher-ng (Debian)
Fix Released
Unknown
apt-cacher-ng (Ubuntu)
Fix Released
High
Unassigned
Lucid
Won't Fix
High
Unassigned

Bug Description

Binary package hint: apt-cacher-ng

Every time I do an "apt-get update" behind the apt-cacher-ng proxy (package version 0.4-1), the proxy seems to leak 6 file descriptors. At this rate it runs out of file descriptors pretty quickly and eventually fails to service connections. It doesn't, however, consume 100% CPU on my computer as described in the Debian bug.

At first apt-get starts printing HTTP errors like:
* 503 Cache storage error
* 503 Cache storage error while opening data file
* 500 Connection failure: Too many open files
and eventually just freezes up with "[Waiting for headers]"

apt-cacher was running fine for a week with ~10 servers, but now it keeps crashing repeatedly. After restarting it works fine until it hits the limit again. The cache server is running Ubuntu 9.10 Karmic inside a KVM virtual machine.

I tried with "apt-get update" from localhost (Karmic) and another Lucid machine, over both IPv4 and IPv6.

In /proc/PID/fd descriptors 5-1023 are all sockets. Netstat shows some connections to 127.0.0.1:3142 and to Ubuntu archives in various closing states.

I obtained the strace using:
sudo -u apt-cacher-ng strace -f apt-cacher-ng 2>apt-cacher-ng.strace
while true; do apt-get update; done

Revision history for this message
Marti (intgr) wrote :
Revision history for this message
Marti (intgr) wrote :
Revision history for this message
Marti (intgr) wrote :
description: updated
summary: - apt-cacher-ng leaks file descriptors: Too many open files, 100 %CPU
- usage
+ apt-cacher-ng leaks file descriptors: Too many open files
Changed in apt-cacher-ng (Debian):
status: Unknown → Fix Released
Revision history for this message
Eduard Bloch (edi-gmx) wrote :

The crash problem sounds like bug #532353, no idea how to solve that. The file handle leak might be solved in Debian version 0.4.7. You seem to be running amd64, try the test build from https://www.unix-ag.uni-kl.de/~bloch/acng/ubuntu/ please.

Revision history for this message
Marti (intgr) wrote :

Indeed, that package fixes the file descriptor leak.

By "crashing" I meant running out of file descriptors in the manner described above -- not SEGV or anything like that.

Revision history for this message
Eduard Bloch (edi-gmx) wrote :

Hey MOTU, if you need a patch to solve just this issue, see attachment.

Changed in apt-cacher-ng (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in apt-cacher-ng (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → High
Changed in apt-cacher-ng (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in apt-cacher-ng (Ubuntu Lucid):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.