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

Re: [Nbd] nbd-client: timeout option not working



On Thu, Jul 21, 2011 at 11:30 AM, Wouter Verhelst <w@...112...> wrote:
> On Thu, Jul 21, 2011 at 04:12:43PM +0200, Valerio Pachera wrote:
>> Off course I tryed to add timeout=3 to nbd-client on the host
>> but...nothing change: the device nbd0 and the relative nbd-client
>> processes stay there till ever (or almost), sure not 3 seconds.
>>
>> On the host
>> nbd-client  timeout=20 192.168.5.2 2000 /dev/nbd1
>> WARNING: old-style command-line argument encountered. This is deprecated.
>> Negotiation: ..size = 1048576KB
>> bs=1024, sz=1048576
>>
>> Why do I get a warning?
>
> Because you used the syntax "timeout=20" rather than "-timeout 20". The
> former is a positional argument, the latter isn't. The '-timeout'
> syntax is also easier to parse. The 'timeout=' may eventually be
> removed, but for now it should give you the same result.
>
>> Why timeout is not working with recent kernels?
>
> I'm not sure, to be honest. If you specify a timeout, nbd-client runs
>
> ioctl(nbd, NBD_SET_TIMEOUT, timeout)
>
> which is supposed to communicate a timeout to the kernel. Beyond that,
> it happens at the other end of the syscall... Paul, any idea?

Yes, that is in there to stop nbd IO from hanging indefinitely in case
the network/server goes down. Instead of waiting for a TCP timeout,
the NBD timeout errors out the hung IO and then shuts the socket down.
Primarily useful for cases where you have redundancy (say raid1) over
the nbd and you can handle the nbd device going away. In many cases
you are better off just letting the IO hang and hoping that the
network/server comes back.

--
Paul



Reply to: