Bug 1116756

Summary: System config printer applet locks up after authenticating one print job
Product: [Fedora] Fedora Reporter: Andre Heinecke <aheinecke>
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 20CC: aheinecke, jpazdziora, jpopelka, marcus.moeller, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: system-config-printer-1.5.1-3.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-23 04:31:04 UTC Type: Bug
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
Comment out main iteration in status icon update
none
Patch to use Gtk's main loop in the D-Bus service none

Description Andre Heinecke 2014-07-07 08:52:13 UTC
Created attachment 916002 [details]
Comment out main iteration in status icon update

We were trying to use system-config-printer-applet to automatically authenticate print jobs over Samba in the background.

This worked nicely with the first print job but for any more jobs the applet did not show a notification and it locked up.

Debugging showed that it locked up in set_statusicon_visibility in the loop:
   
while self.process_pending_events and Gtk.events_pending ():
    Gtk.main_iteration ()

It appeared that update_status (caused by the next iteration) would block on Gdk.threads_enter (). But I failed to find where the thread lock was held in the first place.

I think in this codepath process_pending_events should be false. But I am not sure why / when this should be set or not or where I should set this to false in this case.

Version-Release number of selected component (if applicable):
 1.4.x branch

Steps to Reproduce (might be easier but this is the problem we saw):
1. Create a print job on a Printer that needs Samba authentication
2. Enter credentials and save them in gnome-keyring
3. Start another print job

Actual results:
No notification / job not authenticated. Clicking on the tray icon did nothing.

Expected results:
Job should be automatically authenticated.



Attached hack solved the Problem for us with no appearent regressions caused by it.

Comment 1 Tim Waugh 2014-07-11 16:17:31 UTC
Created attachment 917378 [details]
Patch to use Gtk's main loop in the D-Bus service

Could you try this patch please, instead of the one you're using now?

It tells the jobviewer not to process pending requests, but it also now uses the Gtk main loop -- which I think might fix other similar hangs.

Comment 2 Andre Heinecke 2014-08-19 08:54:39 UTC
Hi,

I've tested the 1.4.x branch installed locally on an Ubuntu 14.4. Without your patch i could reliably reproduce the hang. With your patch it worked flawlessly no more hangs.

Thanks,
Andre

Comment 3 Tim Waugh 2014-08-20 12:34:59 UTC
Thanks! Fixed upstream in commit f8bfb251a00f994de6c796fdb14f8996d2265991.

Comment 4 Fedora Update System 2014-09-02 17:11:20 UTC
system-config-printer-1.5.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/system-config-printer-1.5.1-1.fc21

Comment 5 Fedora Update System 2014-09-06 00:58:24 UTC
Package system-config-printer-1.5.1-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-printer-1.5.1-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-10163/system-config-printer-1.5.1-1.fc21
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-09-08 16:08:34 UTC
Package system-config-printer-1.5.1-2.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-printer-1.5.1-2.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-10163/system-config-printer-1.5.1-2.fc21
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-09-11 22:12:23 UTC
Package system-config-printer-1.5.1-3.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-printer-1.5.1-3.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-10163/system-config-printer-1.5.1-3.fc21
then log in and leave karma (feedback).

Comment 8 Marcus Moeller 2014-09-19 13:41:05 UTC
The problem still occurs with system-config-printer-1.5.1-3.fc21.x86_64

Comment 9 Tim Waugh 2014-09-22 16:21:28 UTC
And there's a report of it fixing the problem for someone else:

https://bugs.launchpad.net/bugs/1291075

Marcus: could it be that you are seeing some other bug?

Comment 10 Fedora Update System 2014-09-23 04:31:04 UTC
system-config-printer-1.5.1-3.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Jan Pazdziora 2014-09-24 06:27:38 UTC
Any chance of getting the fix backported to Fedora 20 as well? I tried to scratch build system-config-printer-1.5.1-3.fc21.src.rpm but the result requires python3-cups. Fedora 20 still has over nine months to live and it'd be nice to see errata for it as well.

Thank you,

Jan

Comment 12 Tim Waugh 2014-09-24 08:02:56 UTC
I'll try to get to that (i.e. a system-config-printer 1.4.6 release) soon.

Comment 13 Marcus Moeller 2014-09-24 08:05:14 UTC
Just to make sure, this patch does not solve the problem that has been described initially. At Tim, the one you linked seems to be different from what I experience here.

Comment 14 Andre Heinecke 2014-09-24 08:54:40 UTC
Hi,

(In reply to Marcus Moeller from comment #13)
> Just to make sure, this patch does not solve the problem that has been
> described initially. At Tim, the one you linked seems to be different from
> what I experience here.

Marcus this patch solves the problem I described in the Original Post. I really could reproduce the freeze without it and the problem no longer existed with this patch.

- Does the Hack I've attached as patch here (commenting out the Main Iteration) work for you?

- Does the applet really stop responding to all user input in your case? In my test I could not even open the job queue after one Print job as it was completely frozen.

If it still does not work for i think we should open a new issue and start debugging on this there.

Comment 15 Marcus Moeller 2014-09-24 09:05:42 UTC
In our case, the first print job gets spooled every time. For all following print jobs, the Queue view of system-config-printer needs to be open in order to spool the jobs. They are listed for 'Held for authentication', but when you open the queue view, they are spooled directly.

Comment 16 Tim Waugh 2014-10-30 12:39:48 UTC
Marcus: it sounds like your application's print dialog isn't asking for authentication when it ought to.

Comment 17 Marcus Moeller 2014-10-30 12:45:50 UTC
I am printing from GTK+3 and password is stored in keyring. Testing on Fedora 21 right now.

Comment 18 Marcus Moeller 2014-10-30 13:21:56 UTC
Re-checked: it was my fault. system-config-printer-applet was not running.