Re: [Nbd] [PATCH 2/2] NBD: allow hung network I/O to be cancelled
- To: "Wouter Verhelst" <w@...112...>
- Cc: nbd-general@lists.sourceforge.net, Paul Clements <paul.clements@...124...>
- Subject: Re: [Nbd] [PATCH 2/2] NBD: allow hung network I/O to be cancelled
- From: "Mike Snitzer" <snitzer@...17...>
- Date: Fri, 24 Aug 2007 18:13:33 -0400
- Message-id: <170fa0d20708241513w5e79f49fv6edb25a7b0c23e89@...18...>
- In-reply-to: <20070824214948.GA8247@...39...>
- References: <46CF101F.4050603@...124...> <46CF1826.9050101@...124...> <170fa0d20708241113y31d2ba95xf30c83c7c4c98cd2@...18...> <20070824214948.GA8247@...39...>
On 8/24/07, Wouter Verhelst <w@...112...> wrote:
> On Fri, Aug 24, 2007 at 02:13:27PM -0400, Mike Snitzer wrote:
> > On 8/24/07, Paul Clements <paul.clements@...124...> wrote:
> > > This patch allows NBD I/O to be cancelled when a network outage occurs.
> > > Previously, I/O would just hang, and if enough I/O was hung in nbd, the
> > > system (at least user-level) would completely hang until a TCP timeout
> > > (default, 15 minutes) occurred.
> > >
> > > The patch introduces a new ioctl NBD_SET_TIMEOUT that allows a transmit
> > > timeout value (in seconds) to be specified. Any network send that
> > > exceeds the timeout will be cancelled and the nbd connection will be
> > > shut down. I've tested with various timeout values and 6 seconds seems
> > > to be a good choice for the timeout. If the NBD_SET_TIMEOUT ioctl is not
> > > called, you get the old (I/O hang) behavior.
> >
> > Hi Paul,
> >
> > Thanks for implementing this! Do you happen to have an associated
> > nbd-client patch for userspace? If not I'd be happy to coordinate
> > with you and Wouter on a patch.
>
> An ioctl isn't that hard ;)
I didn't say it was hard...
> I just committed a patch to the 2.9 branch that should theoretically
> work. Since I don't have a kernel with that patch (yet), I didn't test
> it, but it's pretty trivial.
I tested my patch on a kernel running with Paul's patch. The one
thing I missed early on was the need to reestablish the timeout if
-persist was used. Looks like you missed that too.
regards,
Mike
Reply to: