s3: printing: Fix problem with server taking too long to respond to a MSG_PRINTER_DRV...
commit68c6cb5a6909f50c6d016803881695809ccd1fbb
authorJeremy Allison <jra@samba.org>
Wed, 12 Feb 2014 18:13:19 +0000 (12 10:13 -0800)
committerKarolin Seeger <kseeger@samba.org>
Sun, 23 Feb 2014 03:57:30 +0000 (23 04:57 +0100)
tree403835b69cf63d9f513ba6b9d0bacfc3e2706531
parent23bec26d78547e5a82c79fc3f1fc1f41c0d785da
s3: printing: Fix problem with server taking too long to respond to a MSG_PRINTER_DRVUPGRADE message.

Receiving a MSG_PRINTER_DRVUPGRADE causes
smbd to iterate over all printers looking
for ones that uses the driver. This is a very
expensive operation requiring a read of all
registry printer parameters.

On a system with a large number of printers,
this causes the clients to timeout (smbd
can take longer than 60 seconds to respond).

This patch fixes the problem by forwarding
the MSG_PRINTER_DRVUPGRADE to the background
lpq queue updater process and allowing it to
take care of the updating of the changeid
in the registry, allowing the smbd connected
to the client to return to processing requests
immediately.

https://bugzilla.samba.org/show_bug.cgi?id=9942

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Feb 18 17:48:30 CET 2014 on sn-devel-104

(cherry picked from commit cd655715b8ee0a4e681d67b3996f71017b941401)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Feb 23 04:57:30 CET 2014 on sn-devel-104
source3/printing/nt_printing.c
source3/printing/queue_process.c
source3/rpc_server/spoolss/srv_spoolss_nt.c