Displaying 15 results from an estimated 15 matches for "retry_config".
2019 Sep 20
0
sscanf/stroul (was: Re: [PATCH nbdkit v3 2/3] Add new retry filter.)
On Thu, Sep 19, 2019 at 11:32:47AM -0500, Eric Blake wrote:
> > +static int
> > +retry_config (nbdkit_next_config *next, void *nxdata,
> > + const char *key, const char *value)
> > +{
> > + int r;
> > +
> > + if (strcmp (key, "retries") == 0) {
> > + if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
>...
2019 Oct 01
0
[nbdkit PATCH 3/6] retry: Check next_ops->can_FOO on retry
...m>
---
filters/retry/retry.c | 58 ++++++++++++++++++++++++++++++++++++++-----
1 file changed, 52 insertions(+), 6 deletions(-)
diff --git a/filters/retry/retry.c b/filters/retry/retry.c
index 59e7d4b8..00dbd091 100644
--- a/filters/retry/retry.c
+++ b/filters/retry/retry.c
@@ -106,6 +106,7 @@ retry_config (nbdkit_next_config *next, void *nxdata,
struct retry_handle {
int readonly; /* Save original readonly setting. */
+ unsigned reopens;
};
static void *
@@ -123,6 +124,7 @@ retry_open (nbdkit_next_open *next, void *nxdata, int readonly)
}
h->readonly = readonly;
+...
2019 Sep 19
5
Re: [PATCH nbdkit v3 2/3] Add new retry filter.
...w sub-second retry.
> +static bool exponential_backoff = true;
> +static bool force_readonly = false;
Initializing a static variable to 0 is sometimes worth avoiding (as it
can force .data instead of .bss for a slightly larger binary), but here
it makes sense.
> +
> +static int
> +retry_config (nbdkit_next_config *next, void *nxdata,
> + const char *key, const char *value)
> +{
> + int r;
> +
> + if (strcmp (key, "retries") == 0) {
> + if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
> + nbdkit_error ("c...
2019 Sep 19
0
[PATCH nbdkit v3 2/3] Add new retry filter.
...string.h>
+#include <sys/time.h>
+
+#include <nbdkit-filter.h>
+
+#include "cleanup.h"
+
+static int retries = 5; /* 0 = filter is disabled */
+static int initial_delay = 2;
+static bool exponential_backoff = true;
+static bool force_readonly = false;
+
+static int
+retry_config (nbdkit_next_config *next, void *nxdata,
+ const char *key, const char *value)
+{
+ int r;
+
+ if (strcmp (key, "retries") == 0) {
+ if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
+ nbdkit_error ("cannot parse retries: %s", valu...
2019 Sep 19
0
[PATCH nbdkit 2/2] Add new retry filter.
...string.h>
+#include <sys/time.h>
+
+#include <nbdkit-filter.h>
+
+#include "cleanup.h"
+
+static int retries = 5; /* 0 = filter is disabled */
+static int initial_delay = 2;
+static bool exponential_backoff = true;
+static bool force_readonly = false;
+
+static int
+retry_config (nbdkit_next_config *next, void *nxdata,
+ const char *key, const char *value)
+{
+ int r;
+
+ if (strcmp (key, "retries") == 0) {
+ if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
+ nbdkit_error ("cannot parse retries: %s", valu...
2020 Jul 22
0
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...xdata, readonly) == -1)
> + if (next (nxdata, readonly, exportname) == -1)
> return NULL;
Pre-existing - the log filter should include the exportname somewhere in
its output log. Well, nothing like the present to fix it ;)
> +++ b/filters/retry/retry.c
> @@ -106,16 +106,18 @@ retry_config (nbdkit_next_config *next, void *nxdata,
>
> struct retry_handle {
> int readonly; /* Save original readonly setting. */
> + const char *exportname; /* Client exportname. */
> unsigned reopens;
> bool open;
> };
>
> static vo...
2019 Sep 19
7
[PATCH nbdkit v3 0/3] Add new retry filter.
v2 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00221.html
I think this is more like "the one". It handles reopen failing
correctly, and there is a second test for that. I also ran my sshd
tests locally and it worked in all scenarios I could think up (except
of course sshd not being available at the start, but we want that to
fail).
Rich.
2019 Sep 19
6
[PATCH nbdkit 0/2] Add new retry filter.
This is a retry filter implementation as outlined here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00167.html
It is only lightly tested. One way to test it is to try an SSH copy
(see the commit message for patch 2/2), and in the middle of the copy
kill the per-connection sshd on the remote machine. You will see that
the copy recovers after a few seconds. Add the nbdkit -v
2019 Sep 19
7
[PATCH nbdkit v2 0/4] Add new retry filter.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00199.html
v2:
- Adds a fairly simple yet comprehensive test using sh plugin.
- Rebase and retest.
Patch 1 is a misc patch not really related to the series.
Rich.
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...f (next (nxdata, readonly) == -1)
+ if (next (nxdata, readonly, exportname) == -1)
return NULL;
h = malloc (sizeof *h);
diff --git a/filters/retry/retry.c b/filters/retry/retry.c
index 8037f383..be334c39 100644
--- a/filters/retry/retry.c
+++ b/filters/retry/retry.c
@@ -106,16 +106,18 @@ retry_config (nbdkit_next_config *next, void *nxdata,
struct retry_handle {
int readonly; /* Save original readonly setting. */
+ const char *exportname; /* Client exportname. */
unsigned reopens;
bool open;
};
static void *
-retry_open (nbdkit_next_open *next, void *nxdat...
2019 Oct 01
9
[nbdkit PATCH v2 0/6] Improve retry filter
Includes a rework of the previously posted patch for --run
improvements (mostly with improved comments and commit message; I
decided that waiting for the captive nbdkit to exit was overkill), and
four new patches. The tests are intentionally separate, to allow
rearranging the order of the series to see the failures being fixed.
Eric Blake (6):
server: Propagate unexpected nbdkit failure with
2019 Oct 07
6
[nbdkit PATCH 0/5] More retry fixes
I think this is my last round of patches for issues I identified with
the retry filter. With this in place, it should be safe to interject
another filter in between retry and the plugin.
Eric Blake (5):
retry: Don't call into closed plugin
tests: Refactor test-retry-reopen-fail.sh
tests: Enhance retry test to cover failed reopen
server: Move prepare/finalize/close recursion to
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
..."
-static int retries = 5; /* 0 = filter is disabled */
-static int initial_delay = 2;
+static unsigned retries = 5; /* 0 = filter is disabled */
+static unsigned initial_delay = 2;
static bool exponential_backoff = true;
static bool force_readonly = false;
@@ -67,15 +67,15 @@ retry_config (nbdkit_next_config *next, void *nxdata,
int r;
if (strcmp (key, "retries") == 0) {
- if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
- nbdkit_error ("cannot parse retries: %s", value);
+ if (nbdkit_parse_unsigned ("retries"...
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On Mon, Sep 23, 2019 at 12:05:11PM -0500, Eric Blake wrote:
> > + int nbdkit_parse_long (const char *what, const char *str, long *r);
> > + int nbdkit_parse_unsigned_long (const char *what,
> > + const char *str, unsigned long *r);
>
> Do we really want to encourage the use of parse_long and
> parse_unsigned_long? Those differ between
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
..."
-static int retries = 5; /* 0 = filter is disabled */
-static int initial_delay = 2;
+static unsigned retries = 5; /* 0 = filter is disabled */
+static unsigned initial_delay = 2;
static bool exponential_backoff = true;
static bool force_readonly = false;
@@ -67,15 +67,15 @@ retry_config (nbdkit_next_config *next, void *nxdata,
int r;
if (strcmp (key, "retries") == 0) {
- if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
- nbdkit_error ("cannot parse retries: %s", value);
+ if (nbdkit_parse_unsigned ("retries"...