3 nbdkit-retry-filter - reopen connection on error
7 nbdkit --filter=retry PLUGIN [retries=N] [retry-delay=N]
8 [retry-exponential=yes|no]
9 [retry-readonly=yes|no]
13 C<nbdkit-retry-filter> is a filter that transparently reopens the
14 plugin connection when an error is encountered. It can be used to
15 make long-running copy operations reliable in the presence of
16 temporary network failures, without requiring any changes to the
17 plugin or the NBD client.
19 An alternative and more fine-grained filter is
20 L<nbdkit-retry-request-filter(1)> which will retry only single
23 Several optional parameters are available to control:
29 how many times we retry,
33 the delay between retries, and whether we wait longer each time (known
34 as “exponential back-off”),
38 if we reopen the plugin in read-only mode after the first failure.
42 The default (with no parameters) is designed to offer a happy medium
43 between recovering from short temporary failures but not doing
44 anything too bad when permanent or unrecoverable failures happen. The
45 default behaviour is: we retry 5 times with exponential back-off,
46 waiting in total about 1 minute before we give up.
50 In this example we copy and convert a large file using
51 L<nbdkit-ssh-plugin(1)>, L<qemu-img(1)> and L<nbdkit-captive(1)>.
54 ssh host=remote.example.com /var/tmp/test.iso \
56 --run 'qemu-img convert -p -f raw $nbd -O qcow2 test.qcow2'
58 Without I<--filter=retry> a temporary failure would cause the copy to
59 fail (for example, the remote host’s firewall is restarted causing the
60 SSH connection to be dropped). Adding this filter means that it may
61 be possible to transparently recover.
69 The number of times any single operation will be retried before we
70 give up and fail the operation. The default is 5.
72 =item B<retry-delay=>N
74 The number of seconds to wait before retrying. The default is 2
77 =item B<retry-exponential=yes>
79 Use exponential back-off. The retry delay is doubled between each
80 retry. This is the default.
82 =item B<retry-exponential=no>
84 Do not use exponential back-off. The retry delay is the same between
87 =item B<retry-readonly=yes>
89 As soon as a failure occurs, switch the underlying plugin to read-only
90 mode for the rest of this connection. (A new NBD client connection
91 will still open the plugin in the original mode.)
93 =item B<retry-readonly=no>
95 Do not change the read-write/read-only mode of the plugin when
96 retrying. This is the default.
104 =item F<$filterdir/nbdkit-retry-filter.so>
108 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
114 C<nbdkit-retry-filter> first appeared in nbdkit 1.16.
120 L<nbdkit-readahead-filter(1)>,
121 L<nbdkit-retry-request-filter(1)>.