Bug 976865 - gui blocks waiting for result from sending dbus event
Summary: gui blocks waiting for result from sending dbus event
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.10
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Carter Kozak
Depends On:
Blocks: rhsm-rhel510
TreeView+ depends on / blocked
Reported: 2013-06-21 17:15 UTC by Adrian Likins
Modified: 2013-10-01 13:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-10-01 13:50:23 UTC
Target Upstream Version:

Attachments (Terms of Use)
pycallgraph pdf of subscription-manager-gui registration (162.23 KB, application/pdf)
2013-06-21 17:15 UTC, Adrian Likins
no flags Details

Description Adrian Likins 2013-06-21 17:15:25 UTC
Created attachment 763913 [details]
pycallgraph pdf of subscription-manager-gui registration

Description of problem:

mysubstabt.update_subscription blocks on dbus. In particular, it:

        dbus_iface = get_dbus_iface()

Both those calls block, and can timeout in some cases. In the normal case,
it blocks a little getting dbus_iface, and blocks some more waiting for check_status result. 

The dbus interface probably only needs to be created once per invocation of that widget (or really, once per invocation of subscription-manager) and can be reused. 

The check_status call on the dbus interface ends up invoking /usr/libexec/rhsmd,
which isn't particularly quick, since it initializes alot of the subman stuff again, and makes another server call to check status. 

MySubscriptionsTab.update_subscriptions() can end up getting called alot if there are many changes to entitlement status.

It is run at MySubscriptionsTab init, as well as anytime the entitlement cert file monitor is triggered. It is also involved on unsubscribe.

(And it seems like those cases can race a little bit, and potentially invoke each other...)

See attached "pycallgraph-gui-register.pdf" for an example of the dbus taking a lot of time.

Version-Release number of selected component (if applicable):
versions using server side status (1.8+ more or less)

Possible fixes:

1. Reuse that dbus_iface instead of creating a new one each time

Comment 1 Carter Kozak 2013-07-02 20:33:23 UTC
commit 0a95a841719210e2b6b244377d926a6eab9cf535
Author: ckozak <ckozak@redhat.com>
Date:   Tue Jul 2 09:32:47 2013 -0400

    976865: dbus iface singleton for gui

Comment 3 Carter Kozak 2013-07-15 16:08:38 UTC
This is an optimization bug/fix, if it is implemented properly, QA tests should not detect any difference.

Comment 4 John Sefler 2013-07-17 18:54:14 UTC
I do not have any explicit test coverage to confirm that comment 0 was a problem nor assert that comment 0 is now fixed. 
I also do not have any metrics to confirm that performance has improved with this bug fix.

As suggested in comment 3, I can say that our automated tests have not revealed a regression in behavior with respect to compliance status that has not already been addressed in other bugzillas.  Therefore, I am flipping this bug to VERIFIED without any adverse regression.

[root@jsefler-5 ~]# rpm -q subscription-manager

Additional Info:
No comment on that pycallgraph attachment.

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