From: Eric Blake <eblake@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
vsementsov@virtuozzo.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH for-5.0?] nbd: Attempt reconnect after server error of ESHUTDOWN
Date: Thu, 2 Apr 2020 08:41:31 -0500 [thread overview]
Message-ID: <6b66952d-24a4-593c-2160-8c2877e42f49@redhat.com> (raw)
In-Reply-To: <20200402083826.GY3888@redhat.com>
On 4/2/20 3:38 AM, Richard W.M. Jones wrote:
>
> On Wed, Apr 01, 2020 at 05:38:41PM -0500, Eric Blake wrote:
>> I was trying to test qemu's reconnect-delay parameter by using nbdkit
>> as a server that I could easily make disappear and resume. A bit of
>> experimenting shows that when nbdkit is abruptly killed (SIGKILL),
>> qemu detects EOF on the socket and manages to reconnect just fine; but
>> when nbdkit is gracefully killed (SIGTERM), it merely fails all
>> further guest requests with NBD_ESHUTDOWN until the client disconnects
>> first, and qemu was blindly failing the I/O request with ESHUTDOWN
>> from the server instead of attempting to reconnect.
>>
>> While most NBD server failures are unlikely to change by merely
>> retrying the same transaction, our decision to not start a retry loop
>> in the common case is correct. But NBD_ESHUTDOWN is rare enough, and
>> really is indicative of a transient situation, that it is worth
>> special-casing.
>>
>
> For the case I care about (long running virt-v2v conversions with an
> intermittent network) we don't expect that nbdkit will be killed nor
> gracefully shut down. Instead what we expect is that nbdkit returns
> an error such as NBD_EIO and keeps running.
>
> Indeed if nbdkit actually dies then reconnecting will not help since
> there will be no server to reconnect to.
Hmm. The idea of reconnect-delay in qemu is that if the connection to
the server is dropped, we try to reconnect and then retry the I/O
operation. Maybe what we want is an nbdkit filter which turns EIO
errors from the v2v plugin into forced server connection drops, but
leave nbdkit up and running to allow the next client to connect. That's
different from the existing --filter=retry behavior (where we try to
keep the client connection alive and reopen the plugin), but has a
similar effect (because we force the connection to the client to drop,
the client would have to reconnect to get more data, and reconnecting
triggers a retry on connecting to the plugin). And it's different from
--filter=exitlast (that says to quit nbdkit altogether, rather than just
the current connection with a client).
>
> So I'm neutral about this patch. If you want it for qemu that's fine
> but I don't think it will affect v2v.
Then this patch is no longer 5.0 material. We may still want to improve
shutdown handling in qemu (both in the client and in the server), but
doing it correctly will be bigger than just one patch, based on
Vladimir's response.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-04-02 13:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 22:38 [PATCH for-5.0?] nbd: Attempt reconnect after server error of ESHUTDOWN Eric Blake
2020-04-02 6:41 ` Vladimir Sementsov-Ogievskiy
2020-04-02 13:33 ` Eric Blake
2020-04-02 13:55 ` Eric Blake
2020-04-02 8:38 ` Richard W.M. Jones
2020-04-02 13:41 ` Eric Blake [this message]
2020-04-02 14:04 ` Richard W.M. Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b66952d-24a4-593c-2160-8c2877e42f49@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).