u-d-m downloads stall if the network configuration changes

Bug #1233435 reported by Steve Langasek
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-download-manager
Fix Released
Critical
Manuel de la Peña
ubuntu-download-manager (Ubuntu)
Fix Released
High
Manuel de la Peña

Bug Description

If the network connection drops out underneath ubuntu-download-manager (which may occasionally happen on a mobile device), u-d-m does not recover gracefully. This happened to me today while testing the latest system-image + ubuntu-download-manager; u-d-m got 70MB into a 241MB download, then stalled because the device decided to switch wifi networks, so its address changed.

Relevant bits of syslog, with timestamps:

Sep 30 22:44:09 ubuntu-phablet ubuntu-download-manager[15800]: 2013-09-30 22:44:09,542 - DEBUG - EMIT group progress 79184888 253101266
[...]
Sep 30 22:44:15 ubuntu-phablet wpa_supplicant[1591]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:0f:66:18:c2:5c reason=65534
[...]
Sep 30 22:44:15 ubuntu-phablet kernel: [22186.615410] wlan: disconnected
Sep 30 22:44:15 ubuntu-phablet kernel: [22186.615593] wlan: disconnected
[...]
Sep 30 22:44:30 ubuntu-phablet NetworkManager[1343]: <warn> (wlan0): link timed out.
Sep 30 22:44:30 ubuntu-phablet NetworkManager[1343]: <info> (wlan0): device state change: activated -> failed (reason 'SSID not found') [100 120 53]
Sep 30 22:44:30 ubuntu-phablet NetworkManager[1343]: <warn> Activation (wlan0) failed for connection 'dfsg-net'
[...]
Sep 30 22:44:31 ubuntu-phablet NetworkManager[1343]: <info> Auto-activating connection 'dfsgwpa'.
[...]
Sep 30 22:44:35 ubuntu-phablet dhclient: DHCPREQUEST of 192.168.15.52 on wlan0 to 255.255.255.255 port 67 (xid=0x52f629cf)
Sep 30 22:44:35 ubuntu-phablet dhclient: DHCPOFFER of 192.168.15.52 from 207.224.24.209
Sep 30 22:44:35 ubuntu-phablet dhclient: DHCPACK of 192.168.15.52 from 207.224.24.209
[...]
Sep 30 22:44:36 ubuntu-phablet NetworkManager[1343]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Commit) complete.
[...]

The total network outage (measured from when u-d-m stopped getting data back, rather than from when NM/wpa_supplicant noticed the problem) was 27 seconds, but I waited at least 5 minutes after that for signs of u-d-m resuming, and it didn't do so.

Related branches

Steve Langasek (vorlon)
Changed in ubuntu-download-manager (Ubuntu):
status: New → Incomplete
status: Incomplete → Triaged
importance: Undecided → High
Revision history for this message
Steve Langasek (vorlon) wrote :

u-d-m seems to also have problems if the network drops out briefly, even if this doesn't result in a network configuration change. This seems to be easily reproducible on my N4 when connected to an AP at the edge of range.

Revision history for this message
Manuel de la Peña (mandel) wrote :

Making this my top priority, I'll take a look at what is going on in the internal parts of qt to see if something needs to be changed.

Changed in ubuntu-download-manager:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Manuel de la Peña (mandel)
Changed in ubuntu-download-manager (Ubuntu):
assignee: nobody → Manuel de la Peña (mandel)
Revision history for this message
Manuel de la Peña (mandel) wrote :

I have been debugging this further (but with a nexus 7, sorry I have no other device). The issue I see is the following:

QNetworkInfo::currentNetworkModeChange(QNetworkInfo::NetworkMode mode) =>
    Desktop: The signal is never emitted
    Ubuntu-touch: Signal is emitted, if the wifi is disconnected we get into QNetworkInfo::UnknownMode.

QNetworkInfo::networkStatus(QNetworkInfo::NetworkMode mode, int interface) =>
    Desktop: The signal is never emitted
    Ubuntu-touch: The signal is never emitted

QNetworkAccessManager::networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible)
   Desktop: The signal is never emitted.
   Ubuntu-touch: The signals is never emitted.

QNetworkAccessManager::networkAccessible()
    Ubuntu-tocuh: Allways returns QNetworkAccessManager::UnknownAccessibility

Looks like Qt is not dealing with the network state changes correctly :-/

Revision history for this message
Steve Langasek (vorlon) wrote :

According to Manuel's analysis, this bug appears to lie in the Qt stack itself. Opening a task there.

Changed in qtbase-opensource-src (Ubuntu):
importance: Undecided → High
Revision history for this message
Manuel de la Peña (mandel) wrote :

I have been testing this methods with the latests images and the code works as expected. It does look like it was a problem lower in the stack (not qt). Probably NM of ofono did not work as expected. Setting the bug back to the ubuntu-download-manager to use a workaround when we loose conectivity.

no longer affects: qtbase-opensource-src (Ubuntu)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-download-manager at revision 149, scheduled for release in ubuntu-download-manager, milestone 0.3

Changed in ubuntu-download-manager:
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-download-manager - 0.2+13.10.20131016.1-0ubuntu1

---------------
ubuntu-download-manager (0.2+13.10.20131016.1-0ubuntu1) saucy; urgency=low

  [ Manuel de la Pena ]
  * Remove the file after the successful execution of the post-download
    command line. (LP: #1233209)
  * Listen to the connection state of the device and pause the download
    when we are disconnected. Reconnect asap. (LP: #1233435)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 149
 -- Ubuntu daily release <email address hidden> Wed, 16 Oct 2013 10:03:28 +0000

Changed in ubuntu-download-manager (Ubuntu):
status: Triaged → Fix Released
Changed in ubuntu-download-manager:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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