High CPU usage on broken request to apt-cacher-ng

Bug #999915 reported by JorSol
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt-cacher-ng (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Chris J Arges

Bug Description

I manage a server with apt-cacher-ng, I noted an CPU increase to 100% usage without any aparent reason, it sometimes even freezes so I have to restart the service every time this happen, but sometimes this was about twice a day...

I decided to debug it to see what was happening so I follow the steps in http://www.unix-ag.uni-kl.de/~bloch/acng/html/troublefaq.html in the point 9.5, I compiled the source with DEBUG flag and run it.

The next day I ended with a 2.8GB apt-cacher.err and a infinite loop of:
- target: ooo vs archive.ubuntu.com, ports: 80 vs 80, good config: 0 [<email address hidden>:831|139753806664752]
- >> dlcon::SetupJobConfig [139752724489984 | 139753806664752]
- << dlcon::SetupJobConfig [139752724489984 | 139753806664752]

Some time ago the desktops computers where configured using the following source line:
deb http://serverip:3142/ooo hardy main
/ooo was an alias to a ppa, the alias was removed from the server, and all the new desktops where configured using Acquire::http { Proxy "http://servername:3142"; };
but some of the older machines keep the old format...

I attach a fragment of the log where it start the infinite loop, note the time... it's an 8 seconds fragment log with 130500+ lines.

I have tracked the computer that was sending the request and change the source.list, but this should be fixed in apt-cacher-ng, and handle the request a little more graceful.

--

SRU Justification:

[Impact]
* Users of apt-cacher-ng may see CPU usage of 100% due to a infinite loop in the code.
* The fix for this package is already present in quantal and beyond, and the author has provided the patch on this bug.

[Test Case]
Use apt-cacher-ng and occasionally one may hit this infinite loop error depending on the source.list configuration.

[Regression Potential]
* Small change, present in quantal/raring and upstream.

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

The attached patch should prevent your daemon from looping. Why it actually happened in first place is hard to tell, but with this change the error message should be returned to client ASAP and you can check again.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "stop_looping.diff" 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-reviewers team 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.]

tags: added: patch
Revision history for this message
JorSol (jorsol) wrote :

I confirm that the patch works correctly... this should be pushed upsteam and downstream to precise.

Thanks for your quick response Eduard.

Rolf Leggewie (r0lf)
Changed in apt-cacher-ng (Ubuntu):
importance: Undecided → High
status: New → In Progress
Revision history for this message
pi-rho (pi-rho) wrote :

This is fixed in in the new upstream release 0.7.4

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-cacher-ng - 0.7.4-1ubuntu1

---------------
apt-cacher-ng (0.7.4-1ubuntu1) quantal; urgency=low

  * Merge from Debian unstable. Remaining changes:
    - debian/apt-cacher-ng.logrotate:
      Comment out the "su" lines as this requires logrotate 3.8.1 which isn't
      in Ubuntu yet.
    - drop conflict on logrotate < 3.8.1

apt-cacher-ng (0.7.4-1) unstable; urgency=medium

  * New upstream release
    + prevents endless looping in certain situations (LP: #999915)
    + more tolerance to unstable connections and behavior fix for conflicting
      downloads in maintenance mode (closes: #672801)
  * added a bug-script to present some instructions

apt-cacher-ng (0.7.3-1) unstable; urgency=low

  * New upstream release
    + Fixes FTBFS (missing unistd.h include, closes: #667100)
    + option to disable Range/If-Range for volatile files (LP: #983128)
    + Fixes storage of HTTP header data in cached files under certain
      circumstances (now really closes: #644959)
  * Conflict with older logrotate not understanding "su" (closes: #662760)
  * Process user/group is configurable via default file now (closes: #668421)
 -- Julian Taylor <email address hidden> Fri, 25 May 2012 23:41:35 +0200

Changed in apt-cacher-ng (Ubuntu):
status: In Progress → Fix Released
Chris J Arges (arges)
Changed in apt-cacher-ng (Ubuntu Precise):
assignee: nobody → Chris J Arges (arges)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Chris J Arges (arges) wrote :

Debdiff attached for precise SRU, test build here:
http://people.canonical.com/~arges/lp999915/

description: updated
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Debdiff looks good, ACK.
I've uploaded it to precise-proposed with a slight version change for processing by the SRU team. Thanks!

Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello JorSol, or anyone else affected,

Accepted apt-cacher-ng into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apt-cacher-ng/0.7.2-1ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apt-cacher-ng (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Jonathan Davies (jpds)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-cacher-ng - 0.7.2-1ubuntu2.1

---------------
apt-cacher-ng (0.7.2-1ubuntu2.1) precise-proposed; urgency=low

  [ Eduard Bloch ]
  * Prevents endless looping in certain situations (LP: #999915)
 -- Chris J Arges <email address hidden> Mon, 15 Apr 2013 10:57:22 -0500

Changed in apt-cacher-ng (Ubuntu Precise):
status: Fix Committed → Fix Released
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.