[Samba] select periodically returns 0 then read ETIMEDOUT

赵培 zhaopei05 at gmail.com
Thu Apr 26 22:20:58 MDT 2012


Hi Experts,

I used strace to trace an issue that the session hold the file lock for
about 20 mins after the client disconnected from the network. Then the
session was terminated by Samba.

In the strace output, I found select was being called periodically in a
loop, returning 0. After minutes, 1 was returned by select then read was
called, ETIMEDOUT returned.

As a new hand, just want to know if this is the expected behavior.

The log and the strace output seem too big to be sent. Just attaching a
snip form the strace output:

fstat(33, {st_mode=S_IFREG|0644, st_size=1439773, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
geteuid()                               = 0
write(33, "[2012/04/26 00:00:16.679817, 10]"..., 77) = 77
geteuid()                               = 0
write(33, "  smbd_idle_event_handler: idle_"..., 68) = 68
select(29, [6 8 28], [], NULL, {59, 994672}) = 1 (in [28], left {14,
934695})
read(28, 0x7fff13d0e6c0, 4)             = -1 ETIMEDOUT (Connection timed
out)
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
socket(PF_FILE, 0x80002 /* SOCK_??? */, 0) = 34
connect(34, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
sendto(34, "<27>Apr 26 00:01:01 smbd[32115]:"..., 108, MSG_NOSIGNAL, NULL,
0) = 108
geteuid()                               = 0
write(33, "[2012/04/26 00:01:01.740501,  0]"..., 75) = 75
getpeername(28, 0x7fff13d0e460, [128])  = -1 ENOTCONN (Transport endpoint
is not connected)

Thanks in advance!

Regards,
Pei


More information about the samba mailing list