Bug 996664

Summary: web interface for 'add printer' does not allow backend enough time for discovery
Product: [Fedora] Fedora Reporter: David Woodhouse <dwmw2>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: jpopelka, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cups-1.6.4-2.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-14 07:12:50 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:

Description David Woodhouse 2013-08-13 16:02:38 UTC
It takes a little over five seconds for the back end to discover printers for me.

When clicking 'Add Printer' at http://localhost:631/admin/ the page loads in five seconds. I *sometimes* see my printers, if I'm lucky. But isn't the timeout supposed to be ten seconds? How can I change it?

Comment 1 Tim Waugh 2013-08-14 10:55:11 UTC
This was changed upstream by this commit:

commit a36dc4843b4d370e623e0ebe64b7a747bd65b70b
Author: mike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Date:   Fri Mar 4 17:50:45 2011 +0000

    Reduce printer discovery time to 5 second to prevent "web page is hung" bugs.
    
    
    git-svn-id: http://svn.easysw.com/public/cups/trunk@9576 7a7537e8-13f0-0310-91df-b6672ffda945

diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c
index 1bfd075..81600d4 100644
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -1026,7 +1026,7 @@ do_am_printer(http_t *http,		/* I - HTTP connection */
     fputs("DEBUG: Getting list of devices...\n", stderr);
 
     current_device = 0;
-    if (cupsGetDevices(http, 30, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
+    if (cupsGetDevices(http, 5, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
                        (cups_device_cb_t)choose_device_cb,
 		       (void *)title) == IPP_OK)
     {

Comment 2 David Woodhouse 2013-08-14 11:10:17 UTC
Hm, not configurable?

The ideal solution probably involves JavaScript and an asynchronous loading of the discovery results, but right now I'd settle for *6* seconds instead of 5 for my users and that would mostly fix it.

Or perhaps I can try to learn about python threading and parallelise the two database connections and all the SNMP probing in my discovery backend, and try to bring it consistently down under 5 seconds...

Comment 3 Tim Waugh 2013-08-16 15:46:15 UTC
I've changed it to 10s in:
 cups-1.6.3-7.fc19
 cups-1.7-0.25.rc1.fc20

Comment 4 Fedora Update System 2013-10-11 11:50:07 UTC
cups-1.6.4-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/cups-1.6.4-2.fc19

Comment 5 Fedora Update System 2013-10-11 23:59:02 UTC
Package cups-1.6.4-2.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cups-1.6.4-2.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-18910/cups-1.6.4-2.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-10-14 07:12:50 UTC
cups-1.6.4-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2013-10-14 17:16:38 UTC
cups-1.6.4-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.