From: pcarana Date: Thu, 16 Jan 2020 20:12:31 +0000 (-0600) Subject: Update 'retry' conf default values, fix compile warning at OpenBSD X-Git-Tag: v1.2.0~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c49243e25dfa3c78b93c43cc71c01b74afa6f2d6;p=thirdparty%2FFORT-validator.git Update 'retry' conf default values, fix compile warning at OpenBSD --- diff --git a/docs/usage.md b/docs/usage.md index 62279c57..0f3bb5dc 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -597,8 +597,8 @@ The configuration options are mostly the same as the ones from the `argv` interf "enabled": true, "priority": 50, "retry": { - "count": 1, - "interval": 3 + "count": 2, + "interval": 5 } }, @@ -607,8 +607,8 @@ The configuration options are mostly the same as the ones from the `argv` interf "priority": 50, "strategy": "root", "retry": { - "count": 1, - "interval": 3 + "count": 2, + "interval": 5 }, "program": "rsync", "arguments-recursive": [ @@ -715,18 +715,20 @@ Whenever a certificate has both RSYNC and RRDP repositories, the following crite - **Type:** Integer - **Availability:** `argv` and JSON -- **Default:** 1 +- **Default:** 2 - **Range:** 0--[`UINT_MAX`](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) Maximum number of retries whenever there's an error fetching RRDP files. A value of **0** means **no retries**. +Whenever is necessary to fetch an RRDP file, the validator will try the download at least once. If there was an error fetching the file, the validator will retry at most `--rrdp.retry.count` times to fetch the file, waiting [`--rrdp.retry.interval`](#--rrdpretryinterval) seconds between each retry. + ### `--rrdp.retry.interval` - **Type:** Integer - **Availability:** `argv` and JSON -- **Default:** 3 +- **Default:** 5 - **Range:** 0--[`UINT_MAX`](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) Period of time (in seconds) to wait between each retry to fetch an RRDP file. @@ -807,18 +809,20 @@ Useful if you want `root`, but the root certificate is separated from the rest o - **Type:** Integer - **Availability:** `argv` and JSON -- **Default:** 1 +- **Default:** 2 - **Range:** 0--[`UINT_MAX`](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) Maximum number of retries whenever there's an error executing an RSYNC. A value of **0** means **no retries**. +Whenever is necessary to execute an RSYNC, the validator will try at least one time the execution. If there was an error executing the RSYNC, the validator will retry it at most `--rrdp.retry.count` times, waiting [`--rsync.retry.interval`](#--rsyncretryinterval) seconds between each retry. + ### `--rsync.retry.interval` - **Type:** Integer - **Availability:** `argv` and JSON -- **Default:** 3 +- **Default:** 5 - **Range:** 0--[`UINT_MAX`](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) Period of time (in seconds) to wait between each retry to execute an RSYNC. diff --git a/examples/config.json b/examples/config.json index ceaaaf60..17627732 100644 --- a/examples/config.json +++ b/examples/config.json @@ -33,8 +33,8 @@ "enabled": true, "priority": 50, "retry": { - "count": 1, - "interval": 3 + "count": 2, + "interval": 5 } }, "rsync": { @@ -42,8 +42,8 @@ "priority": 50, "strategy": "root", "retry": { - "count": 1, - "interval": 3 + "count": 2, + "interval": 5 }, "program": "rsync", "arguments-recursive": [ diff --git a/man/fort.8 b/man/fort.8 index 1f7f176e..a60cb670 100644 --- a/man/fort.8 +++ b/man/fort.8 @@ -594,7 +594,12 @@ Maximum number of retries whenever there's an error fetching RRDP files. .P A value of \fI0\fR means no retries. .P -By default, the value is \fI1\fR. +Whenever is necessary to fetch an RRDP file, the validator will try the +download at least once. If there was an error fetching the file, the validator +will retry at most \fI--rrdp.retry.count\fR times to fetch the file, waiting +\fI--rrdp.retry.interval\fR seconds between each retry. +.P +By default, the value is \fI2\fR. .RE .P @@ -603,7 +608,7 @@ By default, the value is \fI1\fR. Period (in seconds) to wait between retries after an error ocurred fetching RRDP files. .P -By default, the value is \fI3\fR. +By default, the value is \fI5\fR. .RE .P @@ -725,7 +730,12 @@ Maximum number of retries whenever there's an error executing RSYNC. .P A value of \fI0\fR means no retries. .P -By default, the value is \fI1\fR. +Whenever is necessary to execute an RSYNC, the validator will try the execution +at least once. If there was an error executing the RSYNC, the validator will +retry it at most \fI--rrdp.retry.count\fR times, waiting +\fI--rsync.retry.interval\fR seconds between each retry. +.P +By default, the value is \fI2\fR. .RE .P @@ -733,7 +743,7 @@ By default, the value is \fI1\fR. .RS 4 Period (in seconds) to wait between retries after an RSYNC error ocurred. .P -By default, the value is \fI3\fR. +By default, the value is \fI5\fR. .RE .P @@ -860,12 +870,20 @@ to a specific value: }, "rrdp": { "enabled": true, - "priority": 50 + "priority": 50, + "retry": { + "count": 2, + "interval": 5 + } }, "rsync": { "enabled": true, "priority": 50, "strategy": "root", + "retry": { + "count": 2, + "interval": 5 + }, "program": "rsync", "arguments-recursive": [ "--recursive", diff --git a/src/config.c b/src/config.c index 8edc7252..0602a565 100644 --- a/src/config.c +++ b/src/config.c @@ -733,8 +733,8 @@ set_default_values(void) rpki_config.rsync.enabled = true; rpki_config.rsync.priority = 50; rpki_config.rsync.strategy = RSYNC_ROOT; - rpki_config.rsync.retry.count = 1; - rpki_config.rsync.retry.interval = 3; + rpki_config.rsync.retry.count = 2; + rpki_config.rsync.retry.interval = 5; rpki_config.rsync.program = strdup("rsync"); if (rpki_config.rsync.program == NULL) { error = pr_enomem(); @@ -753,8 +753,8 @@ set_default_values(void) rpki_config.rrdp.enabled = true; rpki_config.rrdp.priority = 50; - rpki_config.rrdp.retry.count = 1; - rpki_config.rrdp.retry.interval = 3; + rpki_config.rrdp.retry.count = 2; + rpki_config.rrdp.retry.interval = 5; rpki_config.http.user_agent = strdup(PACKAGE_NAME "/" PACKAGE_VERSION); if (rpki_config.http.user_agent == NULL) { diff --git a/src/rtr/db/vrps.c b/src/rtr/db/vrps.c index 2f978792..be7f3bdd 100644 --- a/src/rtr/db/vrps.c +++ b/src/rtr/db/vrps.c @@ -373,7 +373,8 @@ revert_base: int vrps_update(bool *changed) { - time_t start, finish, exec_time; + time_t start, finish; + long int exec_time; serial_t serial; int error;