nbdkit-retry-filter(1) | NBDKIT | nbdkit-retry-filter(1) |
nbdkit-retry-filter - reopen connection on error
nbdkit --filter=retry PLUGIN [retries=N] [retry-delay=N] [retry-exponential=yes|no] [retry-readonly=yes|no]
"nbdkit-retry-filter" is a filter that transparently reopens the plugin connection when an error is encountered. It can be used to make long-running copy operations reliable in the presence of temporary network failures, without requiring any changes to the plugin or the NBD client.
An alternative and more fine-grained filter is nbdkit-retry-request-filter(1) which will retry only single requests that fail.
Several optional parameters are available to control:
The default (with no parameters) is designed to offer a happy medium between recovering from short temporary failures but not doing anything too bad when permanent or unrecoverable failures happen. The default behaviour is: we retry 5 times with exponential back-off, waiting in total about 1 minute before we give up.
In this example we copy and convert a large file using nbdkit-ssh-plugin(1), qemu-img(1) and nbdkit-captive(1).
nbdkit -U - \ ssh host=remote.example.com /var/tmp/test.iso \ --filter=retry \ --run 'qemu-img convert -p -f raw $nbd -O qcow2 test.qcow2'
Without --filter=retry a temporary failure would cause the copy to fail (for example, the remote host’s firewall is restarted causing the SSH connection to be dropped). Adding this filter means that it may be possible to transparently recover.
Use "nbdkit --dump-config" to find the location of $filterdir.
"nbdkit-retry-filter" first appeared in nbdkit 1.16.
nbdkit(1), nbdkit-filter(3), nbdkit-readahead-filter(1), nbdkit-retry-request-filter(1).
Richard W.M. Jones
Copyright (C) 2019 Red Hat Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2023-01-04 | nbdkit-1.32.5 |