Bug 907451

Summary: yast2 needs too much time to generate long lists ("hangup" feeling for the user)
Product: [openSUSE] openSUSE Distribution Reporter: Forgotten User A9YPvv3rEp <forgotten_A9YPvv3rEp>
Component: PrintingAssignee: Johannes Meixner <jsmeix>
Status: RESOLVED DUPLICATE QA Contact: Johannes Meixner <jsmeix>
Severity: Major    
Priority: P5 - None CC: forgotten_A9YPvv3rEp
Version: 13.2   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: screenshot of Yast2
yast log covering printer operations

Description Forgotten User A9YPvv3rEp 2014-11-27 09:38:12 UTC
Created attachment 615220 [details]
screenshot of Yast2

When using YAST2->Hardware->Printer.
Having added a printer via the connection wizard, and tested the connection Yast fails to find any drivers at all. Looking it installed packages reveals the usual pod.gz packages installed.

I have also seen this on a 13.1->tumbleweed upgrade.
Comment 1 Forgotten User A9YPvv3rEp 2014-11-27 10:22:45 UTC
I have just discovered that if you browse to a valid ppd file via the "Driver Packages" button this seems to "unstick" the system and it then lists all drivers, not just the one you specified, and continues to work for other printers too.
Comment 2 Johannes Meixner 2014-11-28 11:23:42 UTC
It needs several seconds when the search string is e.g. "hp"
where very many drivers are available for this manufacturer.

It may need a really long time (several minutes) when no search string
is specified (i.e. to list all drivers for "any model").
 
While it is running "top" shows a "y2base" command that
uses 99% CPU all the time.

The root cause is a slow implementation in YaST core
how it deals with long lists when many elements are added
one after the other to a long list. It becomes slower and slower
the longer the list becomes (because of a "deep copy" inside).

As a workaround for now to speed it up you need to provide
a search string that does not result a very long list of drivers.

For example in the connection wizard select as manufacturer "Generic"
to get a fist list of drivers relatively quickly and then change the
search string from "generic" to one that is relatively specific
for your particular model for example "hp 4000" when you
have a "HP LaserJet 4000".
Comment 4 Johannes Meixner 2014-11-28 11:37:29 UTC
It is fixed in yast2-printer for SLE12
that is not in openSUSE 13.2.

Therefore it is a duplicate of bug#902680
	
Tim Nicholson,

yast2-printer for SLE12 is avaialble in the openSUSE build service
development project "Printing" also for openSUSE 13.2 x86_64 from
http://download.opensuse.org/repositories/Printing/openSUSE_13.2/x86_64/

After I did on my openSUSE 13.2 x86_64 machine:
------------------------------------------------------------------------------
# wget http://download.opensuse.org/repositories/Printing/openSUSE_13.2/x86_64/yast2-printer-3.1.1-1.4.x86_64.rpm

# rpm -Uhv --force yast2-printer-3.1.1-1.4.x86_64.rpm
------------------------------------------------------------------------------
it shows long lists of drivers sufficiently fast again.

Note that yast2-printer for SLE12 has some special adaptions
for CUPS 1.7 (and cups-browsed) but I tried to implement them
in a backward compatible way so that yast2-printer for SLE12
should still work also for CUPS 1.5.4 in openSUSE 13.2.

*** This bug has been marked as a duplicate of bug 902680 ***
Comment 5 Forgotten User A9YPvv3rEp 2014-11-28 11:41:34 UTC
Curious, as my initial search string was the specific printer type!
I was working in a vm so could cut and past from another instance.

Normally when it is searching there is a pop up showing its busy. What I got was the pop up for a moment, and then it went away suggesting the search had finished with no result.
Comment 6 Johannes Meixner 2014-11-28 13:22:25 UTC
I also noticed that in your attachment#615220 [details]
there is neither the
"Determining matching printer drivers..."
popup nor the subsequent optional
"Processing many printer drivers. Please wait..."
popup (the latter is shown if the list of driver items
is greater than 500 entries)
because I always have them when listing many drivers.

If you are interested:
The source code for it is the
  DriverItems(driver_filter_string, preselection)
function in /usr/share/YaST2/modules/Printer.rb

Tim Nicholson,
does it work o.k. for you with yast2-printer from the "Printing" project?
Comment 7 Johannes Meixner 2014-11-28 13:32:10 UTC
Tim Nicholson,
if you have the /var/log/YaST2/y2log or /var/log/YaST2/y2log-*.gz file
from the time when you got the pop up for a moment and then it went away,
please attach it so that I can have a look what went on on your
machine at that time.
Comment 8 Forgotten User A9YPvv3rEp 2014-11-28 14:28:16 UTC
Created attachment 615379 [details]
yast log covering printer operations