Bug 204946 - yum-updatesd wakes up every 100 msec even when doing nothing
Summary: yum-updatesd wakes up every 100 msec even when doing nothing
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: pygobject2
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: wakeup FC6Update
TreeView+ depends on / blocked
 
Reported: 2006-09-01 15:58 UTC by Arjan van de Ven
Modified: 2014-01-21 22:55 UTC (History)
3 users (show)

Fixed In Version: pygobject2-2.12.2-1.fc6
Clone Of:
Environment:
Last Closed: 2006-11-04 18:11:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Arjan van de Ven 2006-09-01 15:58:02 UTC
Description of problem:

yum-updatesd keeps waking up 10 times per second while it's idle. This is
obviously not a good idea, it eats compute and battery power for absolutely no
reason.

To check this, just do

strace -tt -p <pid of python that runs the updated>

I've not yet been able to find where this is coming from but FC6 really
shouldn't ship with this one

Comment 1 Bill Nottingham 2006-09-01 16:35:22 UTC
static gboolean
pyg_signal_watch_prepare(GSource *source,
                         int     *timeout)
{
    /* Python only invokes signal handlers from the main thread,
     * so if a thread other than the main thread receives the signal
     * from the kernel, PyErr_CheckSignals() from that thread will
     * do nothing. So, we need to time out and check for signals
     * regularily too.
     * Also, on Windows g_poll() won't be interrupted by a signal
     * (AFAIK), so we need the timeout there too.
     */
#ifndef PLATFORM_WIN32
    if (pyg_threads_enabled)
#endif
        *timeout = 100;
    return FALSE;
}


Comment 2 Gustavo J. A. M. Carneiro 2006-09-01 17:32:41 UTC
Right, it happens that when thread awareness is enabled in pygobject, the 100ms
timeout is used.

This used to be upstream bug http://bugzilla.gnome.org/show_bug.cgi?id=154779

Comment 3 Arjan van de Ven 2006-09-02 07:35:51 UTC
afaik the kernel only sends signals to threads that don't have them blocked. If
python doesn't want anyone but the main thread to get signals, it should just
block signals on all but the main thread and then by nature, all signals will go
to the main thread....


Comment 4 Gustavo J. A. M. Carneiro 2006-09-02 11:56:34 UTC
Well, I guess we have to tell that to the Python developers, then... :|

Comment 5 Will Woods 2006-10-12 23:54:19 UTC
pygobject 2.12.2 raises the timeout to 1000msec (1s):

http://mail.python.org/pipermail/python-announce-list/2006-October/005285.html

which is lower frequency than many other system services (e.g. avahi-daemon) and
would probably make yum-updatesd insignificant in terms of battery/CPU use.

Comment 6 Jeremy Katz 2006-10-13 05:05:02 UTC
Seems like a good candidate for a quick post FC6 update.   

Comment 7 Matthew Barnes 2006-10-24 17:26:24 UTC
Packaged up gobject-2.12.2-1.fc6.

I'll close this bug once it's available in Fedora Updates.

Comment 8 Matthew Barnes 2006-11-04 18:11:01 UTC
Package pushed to Fedora Updates.  Closing this bug.


Note You need to log in before you can comment on or make changes to this bug.