[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Keep idle, but not dead, clients always ready



On Thu, Jan 18, 2007 at 03:20:22PM -0600, Harry Coin wrote:
> /*
> Background:
> 
> This is an attempt to work around a design flaw in the nbd-client
> nbd-server system where the server terminates a connection presuming
> an idle client has instead, died.  The server, during a -a <xxx> timeout
> shutdown does not ping the idle client or otherwise have a little exchange on
> its socket, it just kills it.

Just for the record,

This is not a design flaw; it's not even a bug. You don't *have* to run
nbd-server with the -a option, and it *does* set the SO_KEEPALIVE socket
option to send TCP-level keepalive request to the client. Thus, it
*will* detect idle clients, even if you don't use the -a option; only
you can't specify what the keepalive timeout is that way.

Changing the way -a operates would require a different type of message
(can't use write or read replies for that), and would require the client
to be able to cope with unexpected server messages, which it currently
isn't. That would probably require quite a bit of work.

> In a partial respose, the client side implemented a --persist option.  Trying
> to make a new connection when it finds the severed connection by the server.

Actually, that's meant as a workaround for when the server goes down. It
is not directly related to the -a option (although the -a option can get
the server go down prematurely).

That being said, I'm sure your code is useful if you want to use the -a
option.

-- 
<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22



Reply to: