Bug 1164854 - When access is restricted, cups-polld retries polling multiple times per second
Summary: When access is restricted, cups-polld retries polling multiple times per second
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cups
Version: 6.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-17 17:44 UTC by jstephen
Modified: 2019-07-11 08:21 UTC (History)
3 users (show)

Fixed In Version: cups-1.4.2-69.el6
Doc Type: Bug Fix
Doc Text:
When the BrowsePoll configuration directive was used and the remote server configured for polling forbade access, the cups-polld process retried accessing immediately in a busy loop. The process consumed all processor time and increased network traffic. With this update, a mandatory delay of ten seconds has been introduced to prevent that. Affected users should also fix their configuration by removing the BrowsePoll line for the server, or adjusting the server to allow remote queries.
Clone Of:
Environment:
Last Closed: 2015-07-22 06:54:59 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1346 normal SHIPPED_LIVE cups bug fix and enhancement update 2015-07-20 17:59:51 UTC

Description jstephen 2014-11-17 17:44:40 UTC
Description of problem:
RHEL6 CUPS Client configured to BrowsePoll will cause cups-polld to go into a continuous loop when access is restricted on the CUPS server. This was reproduced using a CUPS client and server on different networks.

The below messages are printed multiple times per second.

Client error_log:

        E [11/Nov/2014:13:53:23 -0500] [cups-polld 192.168.100.166:631] CUPS-Get-Printers failed: Forbidden
        E [11/Nov/2014:13:53:23 -0500] [cups-polld 192.168.100.166:631] CUPS-Get-Printers failed: Forbidden
        E [11/Nov/2014:13:53:23 -0500] [cups-polld 192.168.100.166:631] CUPS-Get-Printers failed: Forbidden
        E [11/Nov/2014:13:53:23 -0500] [cups-polld 192.168.100.166:631] CUPS-Get-Printers failed: Forbidden
        E [11/Nov/2014:13:53:23 -0500] [cups-polld 192.168.100.166:631] CUPS-Get-Printers failed: Forbidden
        E [11/Nov/2014:13:53:23 -0500] [cups-polld 192.168.100.166:631] CUPS-Get-Printers failed: Forbidden

This appears to be a regression:


$ diff -up ./cups-1.4.2-rhel-6.5/scheduler/cups-polld.c ./cups-1.4.2-rhel-6.6/scheduler/cups-polld.c
--- ./cups-1.4.2-rhel-6.5/scheduler/cups-polld.c	2008-01-07 16:12:17.000000000 -0800
+++ ./cups-1.4.2-rhel-6.6/scheduler/cups-polld.c	2014-11-14 14:51:21.549278483 -0800
@@ -297,6 +297,7 @@ poll_server(http_t      *http,		/* I - H
     fprintf(stderr, "ERROR: %s CUPS-Get-Printers failed: %s\n", prefix,
             cupsLastErrorString());
     ippDelete(response);
+    restart_polling = 1;
     return (-1);
   }

$ git status
# On branch rhel-6.6

$ grep restart_polling *.patch
cups-polld-reconnect.patch:+    restart_polling = 1;

The changelog in cups.spec contains:

    # cups-polld: reconnect on error (bug #769292).
    %patch96 -p1 -b .polld-reconnect


Version-Release number of selected component (if applicable):
cups-1.4.2-67.el6

How reproducible:
Very

Steps to Reproduce:
1. Configure CUPS Server to share printers only on the same network(Allow @LOCAL)
2. Configure CUPS Client to 'BrowsePoll CUPS Server'

Actual results:
cups-polld retries continuosly with no sleep in between

Expected results:
While I worked around the problem by setting the access permissions correctly on the cups server, the client certainly should not DOS the server if access is denied.


Additional info:

Comment 2 Tim Waugh 2014-11-18 12:11:09 UTC
We aren't sleeping when we loop because restart_polling is 1:

   /*
    * Sleep for any remaining time...
    */

    if (remain > 0 && !restart_polling)
      sleep(remain);

But we do need to sleep in order to prevent this busy loop, so I'd suggest

    else if (restart_polling)
      sleep(10);

There is no equivalent upstream fix as cups-polld.c was removed with this bug still remaining as far as I can tell.

Comment 3 jstephen 2014-12-08 23:03:31 UTC
Hello,

I have tested the patch and it resolved this issue in my testing.

E [05/Dec/2014:08:36:18 -0500] [cups-polld 192.168.100.173:631] CUPS-Get-Printers failed: Forbidden
E [05/Dec/2014:08:36:28 -0500] [cups-polld 192.168.100.173:631] CUPS-Get-Printers failed: Forbidden
E [05/Dec/2014:08:36:38 -0500] [cups-polld 192.168.100.173:631] CUPS-Get-Printers failed: Forbidden
E [05/Dec/2014:08:36:48 -0500] [cups-polld 192.168.100.173:631] CUPS-Get-Printers failed: Forbidden
E [05/Dec/2014:08:36:58 -0500] [cups-polld 192.168.100.173:631] CUPS-Get-Printers failed: Forbidden

- Justin

Comment 8 errata-xmlrpc 2015-07-22 06:54:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1346.html


Note You need to log in before you can comment on or make changes to this bug.