Bug 630660

Summary: setroubleshoot browser freezes while checking for policy update
Product: [Fedora] Fedora Reporter: Mads Kiilerich <mads>
Component: setroubleshootAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: carlg, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: setroubleshoot-3.0.24-1.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-02 19:33:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
alternative patch none

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.