apt-proxy hangs when client aborting download

Bug #83783 reported by IC Raibow
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-proxy (Ubuntu)
Incomplete
High
Unassigned

Bug Description

Binary package hint: apt-proxy

Started an apt-proxy on machine raisins to serve packaged for machine jogger.
When i abort (^C) on jogger, apt-proxy hangs. And when i trying to fetch apt packages again aptitude is stalled at 0%, waiting for headers.

After `/etc/init.d/apt-proxy restart`, everything is working ok.

IC Raibow (icrbow)
description: updated
Revision history for this message
ski (skibrianski) wrote :

I can confirm that apt-proxy hangs a lot. I haven't noticed if it is related to client aborts or not (will keep an eye on that). Just now the process itself was hung on me, to the extent that /etc/init.d/apt-proxy stop didn't even work (I had to kill -9 the pid myself).

Revision history for this message
Rolf Leggewie (r0lf) wrote :

I also seems to experience this. Except that apt-proxy is not really hung, but being busy with "something" for quite some time quiten often.

Can you guys look at top and process from the apt-proxy user on the proxy machine?

I wonder if this is related but fetches from the cache are often a lot slower for me than when fetching straight from the Internet and my Internet connection is not all that fast.

Revision history for this message
Stavros Korokithakis (stavrosk) wrote :

I can confirm this under gutsy. It hangs when someone aborts a download, it's fine after a restart.

Rolf Leggewie (r0lf)
Changed in apt-proxy:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Youssef Eldakar (youssefeldakar) wrote :

I, too, have been experiencing hangs with apt-proxy v1.9.35.

Revision history for this message
Elijah Epifanov (elijah-epifanov) wrote :

as a workaround you can change all mirrors to ftp

Revision history for this message
Christian Mangold (neversfelde) wrote :

I can confirm this on gutsy and hardy. "/etc/init.d/apt-proxy restart" is not working for me, I have to kill the pid.

Revision history for this message
Tom Kiesel (tom-nonotyet) wrote :

I can confirm this bug. It's a headache, because I'd like to use apt-proxy to let my high school classroom full of machines tax our overburdened school connection less. It works brilliantly except when it hangs spectacularly, and I ideally want a server I can just forget about.

I'm trying out Elijah's workaround today. If Elijah is right, then the bug would seem to be related to the http handling code (handled as an import) in apt-proxy.py It looks from the Sourceforge page and the project webpage that apt-proxy hasn't seen any development in years. The last CVS commit from a developer on the main component (apt-proxy.py) was 3 years and 1 month ago.

I haven't programmed in Python, but I've been looking for an excuse to learn that language. Does this seem like a bug that a (relative) novice could tackle? I need to get my feet wet with some code anyway, since I might be teaching a programming class next year. Ultimately, I'd like to find a project in Java to help with, but this one is something I use. It's a programming itch that I want scratched, to borrow E.S.R.'s metaphor.

Revision history for this message
Liquid (mr-tim-carr) wrote : Re: [Bug 83783] Re: apt-proxy hangs when client aborting download

Thanks for taking this on and you are right thy this bug has been
around a while. I've not seen dev work on it in 2 years.
Good luck and let us know how you get on.

Tim

Sent from my iPhone

On 1/05/2008, at 4:54 AM, Tom Kiesel <email address hidden> wrote:

> I can confirm this bug. It's a headache, because I'd like to use apt-
> proxy to let my high school classroom full of machines tax our
> overburdened school connection less. It works brilliantly except
> when it
> hangs spectacularly, and I ideally want a server I can just forget
> about.
>
> I'm trying out Elijah's workaround today. If Elijah is right, then the
> bug would seem to be related to the http handling code (handled as an
> import) in apt-proxy.py It looks from the Sourceforge page and the
> project webpage that apt-proxy hasn't seen any development in years.
> The last CVS commit from a developer on the main component (apt-
> proxy.py) was 3 years and 1 month ago.
>
> I haven't programmed in Python, but I've been looking for an excuse to
> learn that language. Does this seem like a bug that a (relative)
> novice
> could tackle? I need to get my feet wet with some code anyway,
> since I
> might be teaching a programming class next year. Ultimately, I'd
> like to
> find a project in Java to help with, but this one is something I use.
> It's a programming itch that I want scratched, to borrow E.S.R.'s
> metaphor.
>
> --
> apt-proxy hangs when client aborting download
> https://bugs.launchpad.net/bugs/83783
> You received this bug notification because you are a direct subscriber
> of the bug.

Revision history for this message
Tom Kiesel (tom-nonotyet) wrote :

After some cursory reading of the code and consulting some Python resources, I don't think I'm up to this challenge in a language I'm this unfamiliar with.... yet.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Is there any alternative or is everybody on broadband these days and does not think about the amount of stuff they download from the ubuntu mirrors?

I guess squid comes to mind. But I guess a specialized solution like apt-proxy would be nice.

Tom, please contact me on IRC or jabber. I am also a python novice and eager to learn the language. Maybe we can try this together?

Revision history for this message
Rolf Leggewie (r0lf) wrote :

I believe we are basically seeing the same effect as http://sourceforge.net/tracker/index.php?func=detail&aid=1802545&group_id=12078&atid=112078

As far as alternatives go, the apt-proxy homepage lists a few, but it does not look like any of them have much momentum.

Revision history for this message
Tom Kiesel (tom-nonotyet) wrote :

One thing we could look into is the twisted libraries. It looks from the source like apt-proxy uses twisted for most of its networking features. Twisted is still under active development:

http://twistedmatrix.com/

One thing I don't know is if apt-proxy circa 2005 isn't fouling up somehow with twisted circa 2008. Ideally, APIs stay stable long term, but you never know.

From reading http://twistedmatrix.com/projects/core/documentation/howto/internet-overview.html it looks like it should be possible to write apt-proxy's networking code so that it doesn't choke on hung/broken client connections or multiple simultaneous requests. Still daunting, given I know nearly nothing about Python yet. Maybe we can work on this some during the summer, Rolf. :)

Revision history for this message
IC Raibow (icrbow) wrote :

You can use apt-cacher instead. It's slightly different, but have more power and does it's job very well.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

I think I will seriously look into apt-cacher-ng

Tom, I chatted a bit with the twisted crowd on IRC and they were very helpful. They made me aware of the unit tests provided by the program itself. The ubuntu package fails quite many. I think this might be an approach to break down this task into bitesize, manageable pieces to fix and an opportunity for us to learn apt-proxy along the way. If we are lucky, we can already fix this bug by fixing the unit tests. Do "apt-get source apt-proxy" and call the "runtests" script. 49 of 160 tests failed for me.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Here is the log from the unittests (have not had a chance yet to look at them closely)

Revision history for this message
Rolf Leggewie (r0lf) wrote :

> I think I will seriously look into apt-cacher-ng

apt-cacher-ng is absolutely fantastic. Development is very fast (latest snapshot in my ppa, a number of bugs fixed compared to the hardy version), the program itself is lightning fast (apt-proxy was a dog). Administration IMHO is also a bit easier once you get the hang of it. I am sold.

Revision history for this message
Micha Moskovic (micha-mosk) wrote :

I looked a bit at the code today to try to make apt-proxy-import create hardlinks instead of copies, and although I am not a Python expert, I found it really messy : there is a lot of useless code in there to replicate functions that already exist in Python. I am not surprised to learn it is buggy. I guess I will also have to use apt-cacher-ng.

Revision history for this message
Justin Lawrence (jl-irj) wrote :

We've used apt-proxy for the last 3 or so years, but there seems to be little improvement in this situation. I'm also giving apt-cacher-ng a try to see if it's any better.

Revision history for this message
Youssef Eldakar (youssefeldakar) wrote :

We switched to using Approx, and it has been doing a pretty good job.

Revision history for this message
Peter Würtz (pwuertz) wrote :

Apt-proxy is a dead project. We really should remove this from the repositories and ubuntu wiki pages as it is not working anymore and people like us searching for an "apt proxy" server continue to stumble upon it.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Debian maintenance seems to have been revived about a month ago

Revision history for this message
Stijn Brouwers (stijnbrouwers) wrote :

I think it has been removed from the repository.
Can you confirm this? If it's removed, it isn't relevant here anymore and the bug can be closed...

Changed in apt-proxy (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Youssef Eldakar (youssefeldakar) wrote :

It looks like apt-proxy has indeed been removed from the Ubuntu repository as of Maverick:

http://packages.ubuntu.com/search?keywords=apt-proxy

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.