aptdaemon doesn't respond to network errors correctly

Bug #626144 reported by Andrew
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aptdaemon
New
Undecided
Unassigned
apt (Ubuntu)
New
Undecided
Unassigned

Bug Description

(A script is attached to demonstrate the behavior)

1) Go to NetworkManager and disconnect from your network
2) Run the script attached

What happens - The update starts, continues for a few seconds and then finishes with the state "exit-sucess"
What should happen - The update starts, fails and raises an error because it can't connect to the internet.

1) Make sure you are connected to the Internet
2) Run the script attached
3) After a few seconds, go to NetworkManager and disconnect yourself from the internet

What happens - The update starts and just hangs
What should happen - The update starts and then fails (raising an error) because it can no longer connect to the internet.

Such behavior is essential for applications like software-updater and the way it works at the moment seems counter-intuitive.

Revision history for this message
Andrew (and471) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

> What should happen - The update starts and then fails (raising an error) because it can no longer connect to the internet.

No, in your case the update should not fail as the error is temporary and the old indexes are just used instead. Failing would mean breaking valid use cases.

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Julian, I also the problem with API changes on the apt level.

But on the aptdaemon level we can make more fine grained error reports. So we could raise different exceptions if it is impossible to build the cache, a single repository index could not fetched or if there seems to be global networking error. Aptdaemon could raise e.g an TransientNetworkError or a RepoDownloadFailed.

Reporting success if it was not possible to update the cache with the latest indexes seems to be wrong.

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Is there a way to get the items of the apt_pkg.Acquire instance during a apt.cache.Cache.update? accessing the items property in the pulse or stop callback results in a segmentation fault. But how reliable is collecting the current items in the pulse callback?

If aptdaemon knows the status of all items it could raise a corresponding error.

Changed in debian:
status: Unknown → New
Mathew Hodson (mhodson)
affects: debian → apt (Ubuntu)
Changed in apt (Ubuntu):
importance: Unknown → Undecided
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.