Bug 630660 - setroubleshoot browser freezes while checking for policy update
Summary: setroubleshoot browser freezes while checking for policy update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: setroubleshoot
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-06 15:06 UTC by Mads Kiilerich
Modified: 2011-02-02 19:33 UTC (History)
3 users (show)

Fixed In Version: setroubleshoot-3.0.24-1.fc13
Clone Of:
Environment:
Last Closed: 2011-02-02 19:33:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
alternative patch (2.67 KB, patch)
2010-09-06 15:10 UTC, Mads Kiilerich
no flags Details | Diff

Description Mads Kiilerich 2010-09-06 15:06:59 UTC
The fix for bug 621709 wasn't (sufficiently) perfect.

Adding "import time;time.sleep(10)" to /usr/share/setroubleshoot/updater.py and running "sealert -b" shows that the GUI freezes until the policy version has been checked. That happens In Real Life when I have many repos configured and a slow connection and a slow DNS.

The reason is that gobject.timeout_add runs in the gtk main thread and stdout.readline is blocking and thus blocks the gtk main thread.

A solution is to do nothing until the subprocess has terminated:

--- /tmp/browser.py	2010-09-06 16:42:16.000000000 +0200
+++ /usr/lib/python2.6/site-packages/setroubleshoot/browser.py	2010-09-06 16:55:42.000000000 +0200
@@ -296,6 +296,9 @@
     def read_pipe(self):
         while 1:
             self.updaterpipe.poll()
+            if self.updaterpipe.returncode is None:
+                yield True
+                continue
             if self.updaterpipe.returncode:
                 self.current_policy_label.set_markup("<small><b>%s</b></small>" % _("Error while checking policy version."))
                 yield False

Comment 1 Mads Kiilerich 2010-09-06 15:10:02 UTC
Created attachment 443317 [details]
alternative patch

This alternative patch is more invasive - but better, IMHO.

- refactoring the generator to have two distinct states
- use "in" instead of the C-like "find"

Comment 2 Carl G. 2010-09-09 19:26:34 UTC
Confirmed in F14.

Comment 3 Daniel Walsh 2011-01-25 14:55:55 UTC
Upgrading to the F14/F15 version of setroubleshoot.

Fixed in setroubleshoot-3.0.24-1.fc13

Comment 4 Fedora Update System 2011-01-25 15:26:01 UTC
setroubleshoot-3.0.24-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/setroubleshoot-3.0.24-1.fc13

Comment 5 Fedora Update System 2011-01-25 20:59:22 UTC
setroubleshoot-3.0.24-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update setroubleshoot'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/setroubleshoot-3.0.24-1.fc13

Comment 6 Fedora Update System 2011-02-02 19:32:02 UTC
setroubleshoot-3.0.24-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


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