[Samba] deadtime/keepalive not working as expected
jra at samba.org
Thu Nov 3 16:16:02 UTC 2016
On Thu, Nov 03, 2016 at 03:36:01PM +0100, Volker Lendecke via samba wrote:
> On Tue, Nov 01, 2016 at 05:09:34PM -0700, Jeremy Allison via samba wrote:
> > On Tue, Nov 01, 2016 at 05:16:47PM -0500, Ed Siefker via samba wrote:
> > > My expectations are probably wrong, but I had to manually kill a process
> > > to unlock a file when I think it should have killed itself.
> > >
> > > I have deadtime set to 15 and keepalive at default (300). I opened a file on
> > > my server in Excel, then shut down the machine. Hours later someone
> > > tells me the file is locked.
> > >
> > > Shouldn't keepalive have detected that the machine was off in 5 minutes?
> > > Shouldn't deadtime have disconnected the process and unlocked the file
> > > 15 minutes later? Do I misunderstand what is going on? Thanks
> > Once the client is dead the TCP keepalive's should
> > detect the socket is down and thus shut off the servicing
> > smbd. Check this by doing a wireshark capture and a
> > debug level 10 on that smbd.
> Is that still valid for SMB2? On Linux I always use socket options for
> that these days:
> socket options = TCP_NODELAY TCP_KEEPCNT=4 TCP_KEEPIDLE=240 TCP_KEEPINTVL=15
That's what I said - TCP keepalives should detect the client is down.
I think the deadtime handler is still installed on the event context
in SMB2, so that will fire if the client closed all resources went
away. If the server thinks the client still has a connection (share)
open the deadtime won't disconnect the client - but the TCP keepalives
More information about the samba