system-config-printer: no way to cancel 'searching for printers'

Bug #139335 reported by Peter Maydell
This bug report is a duplicate of:  Bug #165197: 'New Printer' = hang over network. Edit Remove
6
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Binary package hint: system-config-printer

Package: system-config-printer
Version: 0.7.73+svn1429-0ubuntu1

On xubuntu, if you select 'Settings->Printing' from the xfce menu, it brings up the system-config-printer dialog.
If you then hit 'New printer' a dialog is popped up saying 'Searching for printers' with a light bulb icon.

This dialog box has no cancel button or window furniture, so there's no way to cancel the search if you hit 'new printer' by mistake. You just have to sit there and wait for it to finish.

It would be nice if this dialog box had a more standard UI including a 'cancel button' to let you stop the search early.

Changed in system-config-printer:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
William F Pearson (wfpearson) wrote :

Running Gutsy Pre-Beta
Version: 0.7.75+svn1566-0ubuntu1

I believe this bug importance should be escalated. On Class B network it took over half an hour to search for every printer on the network. Without a cancel button, adding multiple printers graphically would be an absolute pain in my butt. A prompt "Do you want to search the network for printers now?" would be useful on smaller networks. Thanks for all your hard work.

Revision history for this message
Tim Waugh (twaugh) wrote :

William: I agree about the cancel button, but I would also like to understand why the process takes so long on your network. Would you please run each of the programs in /usr/lib/cups/backend in turn and try to discover which of them is taking so much time?

Revision history for this message
William F Pearson (wfpearson) wrote :

some of those programs exit immediately. The only one that runs with output is snmp. The process ends in 7 seconds. There are no local printers attached to my system, usb, bt, parallel or serial(com). There is some other process that is causing the delay. Here's the console output:

gksudo system-config-printer
Treating Boolean option HPOption_Tray3 as PickOne
Treating Boolean option HPOption_Tray4 as PickOne
fetchDevices
Lock acquired for devices thread
Devices thread started
Connecting (devices)
Fetching devices #Delay occurs here for approximately 10-15 minutes.
Closing connection (devices)
Releasing devices lock
Got devices
queryPPDs
Lock acquired for PPDs thread
PPDs thread started
Connecting (PPDs)
Fetching PPDs
Closing connection (PPDs)
Releasing PPDs lock

Just to clarify my previous statement: It took me half an hour to add two printers, because the wizard searched for printers both times.

Revision history for this message
William F Pearson (wfpearson) wrote :

Sorry I wanted to add. There are hundreds of printers on my network and this application finds dozens of them, The process is lengthy because it fetches detailed information about each printer including PPD information. That's extremely handy with a few network printers, but it doesn't scale well.

Revision history for this message
Tim Waugh (twaugh) wrote :

How strange. How long does '/usr/sbin/lpinfo -v' take? I'm trying to work out if it's CUPS or system-config-printer causing the delay.

Revision history for this message
William F Pearson (wfpearson) wrote :

 time /usr/sbin/lpinfo -v >/dev/null
real 0m3.628s
user 0m0.016s
sys 0m0.016s

I think the delay happens during PPD search process. It's when the printers respond with the make/model/driver query via ipp on port 9100.

I don't think there is a problem with system-config-printer per se. It's a problem with network latency, aggravated by the quantity of printers on our network. I'm sure there's an netstat on nmap command that would verify this, but I'll claim ignorance. I can attest that cpu or disk activity doesn't spike during the delay.

Revision history for this message
Tim Waugh (twaugh) wrote :

But.. we don't query the printers for PPDs. Not just that we don't do it at that point -- we don't do it at all. The only PPD that is fetched (from the CUPS server you're connected to, likely the local machine) is the one for the current printer selected.

"Fetching devices" is the equivalent of 'lpinfo -v'.

So how long does 'lpinfo -m' take? This fetches the list of available PPDs from the CUPS server, and foomatic might take some time to generate them.

Revision history for this message
William F Pearson (wfpearson) wrote : Re: [Bug 139335] Re: system-config-printer: no way to cancel 'searching for printers'

$lpinfo -m
real 0m5.633s
user 0m0.508s
sys 0m0.216s

Apparently that's not the delay either.

Revision history for this message
Tim Waugh (twaugh) wrote :

Are you connecting to the CUPS server on the local machine, or on another machine? The window title ("Printer configure - %s") will tell you which CUPS server it is actually connected to.

I'm baffled as to why you see such a large delay at "Fetching devices" but not with 'lpinfo -v' unless the device searches are being done on different machines.

Revision history for this message
William F Pearson (wfpearson) wrote :

It's connecting to localhost

I ran it a couple of more times from the command line. It looks like the
delay is occuring at "Got devices"

Sorry about that.

Revision history for this message
Tim Waugh (twaugh) wrote :

See also bug #165197.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you do the following:

wget http://www.openprinting.org/download/printing/dnssd
sudo apt-get install avahi-utils
chmod +x dnssd
time ./dnssd
time /usr/lib/cups/backend/snmp

Please tell how long the two programs need and which printers they report.

/usr/lib/cups/backend/snmp is the standard program of CUPS to search for network printers. It does an SNMP broadcast and collects the answers from the printers. dnssd is a replacement for this program written by me which uses mDNS/DNS-SD/Zeroconf/Bonjour for searching for printers on the network. They do not necessarily find the same set of printers, as older printers can only support SNMP and newer only DNS-SD.

If the result of dnssd is more satisfying for you, do

sudo cp dnssd /usr/lib/cups/backend/
sudo chmod -x /usr/lib/cups/backend/snmp

If you are on Hardy, dnssd is already included in the CUPS package (1.3.4-1ubuntu2 or newer). Then you do not need to do the above-mentioned manual download and installation.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Independent of searching for faster methods to find network printers system-config-printer should also get improved: Why can the scan not be launched as a background process while a waiting window with a cancel button is shown. If the cancel button is clicked, the scanning process gets killed. Then there should be still manual methods to be offered to set up a new printer.

Revision history for this message
Tim Waugh (twaugh) wrote :

As this report mentions the presence of a large number of network printers, I have checked in a speed improvement for this case as revision 1750 in SVN. Till, I wonder if you could build a package with that change in, to see if it makes a difference here?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The new system-config-printer package with performance improvements is in place now:

http://www.linux-foundation.org/~till/tmp/ubuntu/hardy/system-config-printer/

Please download and test these packages.

Note that this is not a fix for the bug. A possibility to cancel the scan in system-config-printer is still needed. Please also do the performance test of the two scanning methods as I have described earlier in this bug report.

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

The remaining issue is now that there is no Cancel button when scanning for network printers, which can take a long time on large nets. That's now the same as bug 165197.

Revision history for this message
Tres Finocchiaro (tres-finocchiaro) wrote :

On a class B network, setting up a printer with Gnome is very cumbersome. In the time I was waiting for scanning, I managed to do the following:

sudo apt-get install kdeprint

kprinter

Click magic wand icon, set up new printer.

Kde's printing dialogs are much more intuitive, much faster, and do offer scanning as an option. The printer will still list and be configurable in gnome once you have it set up.

As I'm typing this, the scanning dialog is still floating above Firefox, and I'm going to xkill the app.

I'm not bashing gnome's efforts, (I prefer gnome at work) but if you need a printer set up in a timely fashion in a large business, this is a great alternative.

-Tres

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.