I was experiencing a big delay in opening printers served from a Samba
station on workstations running both Win2k and WinXP. The delay occurs
whenever anything specific to the printer is opened. For example bringing up
the job queue for the printer and opening the properties dialog for the
printer both produce the delay. Cranking up the logging level and combing
through showed the delay was being caused by a name lookup for the
workstation connecting to the Samba server.
A clip from the log file where you can see the 10 second gap between the 3rd
and 4th items:
[2002/07/19 14:09:47, 4]
rpc_server/srv_lsa_hnd.c:find_policy_by_hnd_internal(168)
Found policy hnd[0] [000] 00 00 00 00 03 00 00 00 00 00 00 00 0B 72 38 3D
........ .....r8[2002/07/19 14:09:47, 4] lib/util.c:dump_data(1537)
[010] 73 49 00 00 sI..
[2002/07/19 14:09:47, 3] libsmb/namequery.c:resolve_hosts(808)
resolve_hosts: Attempting host lookup for name TWWS4<0x20>
[2002/07/19 14:09:57, 0]
rpc_client/cli_spoolss_notify.c:spoolss_connect_to_client(79)
connect_to_client: Can't resolve address for TWWS4
[2002/07/19 14:09:57, 5] rpc_parse/parse_prs.c:prs_debug(60)
000000 spoolss_io_r_rffpcnex
[2002/07/19 14:09:57, 5] rpc_parse/parse_prs.c:prs_werror(618)
0000 status: WERR_OK
When the server can correctly resolve the name through the hosts file or
lmhosts file it tries to connect to the workstation:
[2002/07/19 14:10:15, 3] libsmb/namequery.c:resolve_hosts(808)
resolve_hosts: Attempting host lookup for name TWWS4<0x20>
[2002/07/19 14:10:15, 3] lib/util_sock.c:open_socket_out(845)
Connecting to 192.168.0.104 at port 445
[2002/07/19 14:10:15, 2] lib/util_sock.c:open_socket_out(874)
error connecting to 192.168.0.104:445 (Connection refused)
[2002/07/19 14:10:15, 3] lib/util_sock.c:open_socket_out(845)
Connecting to 192.168.0.104 at port 139
Even when it tries to connect it isn't successful:
[2002/07/19 14:10:16, 0]
libsmb/cliconnect.c:attempt_netbios_session_request(1091)
attempt_netbios_session_request: TWWS4 rejected the session for name
*SMBSERVER with error Called name not present
[2002/07/19 14:10:16, 0]
rpc_client/cli_spoolss_notify.c:spoolss_connect_to_client(98)
connect_to_client: machine TWWS4 rejected the NetBIOS session request.
[2002/07/19 14:10:16, 5] rpc_parse/parse_prs.c:prs_debug(60)
000000 spoolss_io_r_rffpcnex
Because I use dynamic IPs on my lan I can't keep the hosts or lmhosts files
up to date with all of the name to ip mappings. So I changed
name resolve order = lmhosts
and then left the lm hosts file blank. Now there is no delay for the name
lookup, but the connection back to the workstation is never made. Printing
proceeds as normal, seemingly with full functionality. Why is the server
trying to connect back to the workstation when a printer is explored? What
information is communicated on this socket? As printing can proceed normally
without it, is there a way to disable it?
I'd like to change my name resolve order back to something sensible, but
can't afford to reintroduce a 10-20 second delay every time someone wants to
use the printer. The client just hangs during this delay (Yay windows
networking drivers!).
I thought the 'talkback' socket might be produced by the underlying
printing
demon, CUPS in this case, but disabling cups still produces the socket
attempt, so it seems like it's coming from something internal to Samba.
Anyone have any ideas?
Dave