Printer plugin should not block on (libcups) network requests
@misc
Submitted by Michael Link to original bug (#725440)
Description
So here is how the problem can be fiarly reliably reproduced:
I use my laptop at work and at home, with suspend to memory, I often end with gnome-setting-daemon being block. Among various symptoms, keyboard shortcut do not work ( like increase the luminosity, launch a specific software ).
Upon investigation, i found that g-s-d is blocked on this :
#0 0x0000003b5e0ea9dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x0000003b30436aae in poll (__timeout=250, __nfds=1, __fds=0x7fff102516b0) at /usr/include/bits/poll2.h:46
#2 httpAddrConnect2 (addrlist=0x23536f0, sock=sock@entry=0x2363200, msec=msec@entry=30000, cancel=cancel@entry=0x0) at http-addrlist.c:243
#3 0x0000003b3043550e in httpReconnect2 (http=http@entry=0x2363200, msec=msec@entry=30000, cancel=cancel@entry=0x0) at http.c:2726
#4 0x0000003b304546df in cupsSendRequest (http=http@entry=0x2363200, request=request@entry=0x2377d70, resource=resource@entry=0x7f8e64e220d9 "/",
length=length@entry=212) at request.c:732
#5 0x0000003b30454acd in cupsDoIORequest (http=0x2363200, http@entry=0x0, request=request@entry=0x2377d70, resource=resource@entry=0x7f8e64e220d9 "/",
infile=infile@entry=-1, outfile=outfile@entry=-1) at request.c:235
#6 0x0000003b30454e36 in cupsDoRequest (http=http@entry=0x0, request=request@entry=0x2377d70, resource=resource@entry=0x7f8e64e220d9 "/") at request.c:328
#7 0x00007f8e64e20fa1 in process_new_notifications (user_data=0x1d43460, user_data@entry=<error reading variable: value has been optimized out>)
at gsd-print-notifications-manager.c:888
#8 0x0000003b60c49e43 in g_timeout_dispatch (source=source@entry=0x1f97e50, callback=<optimized out>, user_data=<optimized out>) at gmain.c:4451
#9 0x0000003b60c492a6 in g_main_dispatch (context=0x1ce9b50) at gmain.c:3066
#10 g_main_context_dispatch (context=context@entry=0x1ce9b50) at gmain.c:3642
#11 0x0000003b60c49628 in g_main_context_iterate (context=0x1ce9b50, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713
#12 0x0000003b60c49a3a in g_main_loop_run (loop=0x1d09bb0) at gmain.c:3907
#13 0x0000003d53daa355 in gtk_main () at gtkmain.c:1158
#14 0x0000000000403a85 in main (argc=1, argv=0x7fff10259c88) at main.c:471
My analysis is that cupsDoRequest is synchronous, and if it cannot connect to the cups server ( cups.emea.example.org, in my case ), it wait around 30 seconds, but block the rest of the process.
To test, that's quite easy, add a cups server
$ cat /etc/cups/client.conf Servername cups.emea.example.org
Then block the access to the server, either by having the server blocking, or just nullrouting the address ( or block on the firewall).
In my case, this happen when i am connected to the entreprise LAN, and then suspend the laptop and unsuspend it at home. The connectivity to the cups server is no longer working until I start the corporate VPN.
Version: 3.10.x