Message flood to interface=org.ofono.Manager; member=GetModems

Bug #1235138 reported by Alfonso Sanchez-Beato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-download-manager
Fix Released
Low
Manuel de la Peña

Bug Description

More than 300 hundred are sent by ubuntu-download-manager on system boot to interface org.ofono.Manager, method GetModems. This affects negatively the startup time.

In the tarball there are 2 syslogs, which contain:
* syslog_7: Traces on boot with ubuntu-download-manager activated
* syslog_8: Traces on boot with ubuntu-download-manager removed from system-services

The message sent by ubuntu-download-manager in syslog_7 can be seen searching for

interface=org.ofono.Manager; member=GetModems

The last serial number for that d-bus connection is 334. The messages are not sent any more when ubuntu-download-manager stops.

Related branches

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

This might be one of the causes of bug #1226145

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

There is an interesting relationship with bug #1226145: the 300 GetModems calls to ofono are reduced to 30-40 if I use the telepathy-ofono branch that solves that bug. So interactions between telepathy-ofono / ofonod / ubuntu-download-manager produce this bad behaviour.

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

After some more testing, I noticed that I can reproduce the bug whenever the phone loses coverage. If you start ubuntu-download-manager in that situation, QNetworkInfo (class from library libQt5SystemInfo.so) sends 20 GetModems message each 2 seconds to ofonod via D-Bus. The explanation is as follows:

1.- QNetworkInfoPrivate::onTimeout() is called each 2 seconds

2.- onTimeout() calls QNetworkInfoPrivate::getCurrentNetworkMode(), where QNetworkInfoPrivate::networkStatus() is called for different technologies.

3.- The calls related to the bug are for technologies LteMode, WcdmaMode, CdmaMode, GsmMode, TdscdmaMode: each one is called for the cases of HomeNetwork and Roaming: that makes 10 calls to networkStatus()

4.- networkStatus() calls to QNetworkInfoPrivate::getNetworkStatus(), which in the case of the mentioned technologies calls QOfonoWrapper::allModems() twice. That makes 20 calls to allModems(), which calls to QOfonoWrapper::getAllModems(), which finally makes the D-Bus call. Once we have the path to the modem (that's the data used from GetModems), QOfonoWrapper::networkStatus() is called.

That is certainly much more calls than needed. Modem data should be cached in QOfonoWrapper as is network status data, and wait for signals from ofono for changes. QOfonoWrapper::watchAllModems is set to false when radio is disconnected. Besides, we can half the number of calls to GetModem simply using the local variable "modems" in getNetworkStatus().

And the calls for different radio technologies/registration types also seems overkill, as those can be retrieved as properties from ofono interfaces. Even onTimeout() can be avoided if we wait for signals instead.

The code for the library is in package libqt5systeminfo5 in the case of Ubuntu Phone. The files containing the related code are qnetworkinfo_linux.cpp and qofonowrapper.cpp

Tony Espy (awe)
Changed in ubuntu-download-manager:
status: New → Confirmed
Changed in ubuntu-download-manager:
assignee: nobody → Manuel de la Peña (mandel)
status: Confirmed → In Progress
importance: Undecided → Low
Changed in ubuntu-download-manager:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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