← Back to team overview

touch-packages team mailing list archive

[Bug 1470750] Re: scoperegistry uses 45% CPU after applying updates from the store, draining battery quickly

 

This is almost certainly caused by zmq. If the scope disappears
unexpectedly, and there is a message from the registry to the scope
pending, zmq by default tries to re-connect to the peer once every
millisecond. If you look at the registry, you won't see anything unusual
because all its threads will be exactly where you'd expect them to be.
The re-connect spinning happens inside one of zmq's threads.

I've come across this once before. I'll try and dredge up the details.
Basically, what I did was to add a reaper mechanism to the outgoing
connection pool that trashes the socket if the request fails.

I'm wondering whether, possibly, this is happening on a oneway request
from the registry to the scope?

There is a way to set a zmq socket option that adjusts the retry
interval to something less aggressive. But setting that wouldn't fix the
problem; instead, the registry would still be trying to re-connect
indefinitely, just less often. zmq does not allow the number of retries
to be restricted to some limit. As far as I know, the only way to stop
the problem is to trash the offending socket.

It would be good to know what invocation is in flight when we enter that
state.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-api in
Ubuntu.
https://bugs.launchpad.net/bugs/1470750

Title:
  scoperegistry uses 45% CPU after applying updates from the store,
  draining battery quickly

Status in the base for Ubuntu mobile products:
  Confirmed
Status in unity-scopes-api package in Ubuntu:
  Confirmed

Bug description:
  current build number: 44
  device name: arale
  channel: ubuntu-touch/rc-proposed/meizu.en
  last update: 2015-07-02 07:10:44
  version version: 44
  version ubuntu: 20150702
  version device: 20150608-6e66f3c
  version custom: 20150602-731-5-32

  Suddenly this morning, the battery started discharging very quickly,
  'top' revealed that scoperegistry was using around 45% CPU steadily.

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
   2207 phablet   20   0  377996   9576   6200 S  46,0  0,5  67:34.54 scoperegistry

  Around the same time that the battery started dropping, I applied all the updates from the store, in the list of apps to update were:
  - Terminal
  - BBC Sport
  - BBC
  - Euronews
  - Engadget
  - Cnet

  I pressed 'Update all' and waited until it's done then closed system-
  settings.

  There is no crash file corresponding to this event.

  I reproduced it on ubuntu-touch/rc-proposed/bq-aquaris.en/krillin #55

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1470750/+subscriptions


References