Welcome! Log In Create A New Profile

Advanced

[PATCH 1/2] DOC: mworker: Update messages referencing exit-on-failure

Posted by Tim Düsterhus 
From: Tim Duesterhus <[email protected]>

Commit 4cfede87a313456fcbce7a185312460b4e1d05b7 removed
`exit-on-failure` in favor of `no-exit-on-failure`, but failed
to update references to the former in user facing messages.

This should be backported to haproxy 1.8.
---
src/cfgparse.c | 2 +-
src/haproxy.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index 8486f0faa..baf9e60f7 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -742,7 +742,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
if (!strcmp(args[1], "no-exit-on-failure")) {
global.tune.options |= GTUNE_NOEXIT_ONFAILURE;
} else {
- ha_alert("parsing [%s:%d] : '%s' only supports 'exit-on-failure' option.\n", file, linenum, args[0]);
+ ha_alert("parsing [%s:%d] : '%s' only supports 'no-exit-on-failure' option.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
diff --git a/src/haproxy.c b/src/haproxy.c
index df8d34e74..5f3e3948d 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -761,7 +761,7 @@ restart_wait:
ha_alert("Current worker %d left with exit code %d\n", exitpid, status);
if (status != 0 && status != 130 && status != 143
&& !(global.tune.options & GTUNE_NOEXIT_ONFAILURE)) {
- ha_alert("exit-on-failure: killing every workers with SIGTERM\n");
+ ha_alert("Killing every worker with SIGTERM\n");
mworker_kill(SIGTERM);
}
} else {
--
2.15.1
Hi Tim,

On Mon, Dec 04, 2017 at 03:53:30PM +0100, Tim Düsterhus wrote:
> From: Tim Duesterhus <[email protected]>
> --- a/src/haproxy.c
> +++ b/src/haproxy.c
> @@ -761,7 +761,7 @@ restart_wait:
> ha_alert("Current worker %d left with exit code %d\n", exitpid, status);
> if (status != 0 && status != 130 && status != 143
> && !(global.tune.options & GTUNE_NOEXIT_ONFAILURE)) {
> - ha_alert("exit-on-failure: killing every workers with SIGTERM\n");

I prefer to leave this one, because otherwise the user won't understand why it
killed the workers, and a grep on "exit-on-failure" in the documentation will
find "no-exit-on-failure" so that's not a problem.

--
William Lallemand
Replace "left" / "leaving" with "exit" / "exiting".
---
src/haproxy.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/haproxy.c b/src/haproxy.c
index df8d34e74..108a02ab0 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -739,7 +739,7 @@ restart_wait:
}

if (exitpid == -1 && errno == ECHILD) {
- ha_warning("All workers are left. Leaving... (%d)\n", status);
+ ha_warning("All workers exited. Exiting... (%d)\n", status);
atexit_flag = 0;
exit(status); /* parent must leave using the latest status code known */
}
@@ -754,18 +754,18 @@ restart_wait:
status = 255;

if (!children) {
- ha_warning("Worker %d left with exit code %d\n", exitpid, status);
+ ha_warning("Worker %d exited with code %d\n", exitpid, status);
} else {
/* check if exited child was in the current children list */
if (current_child(exitpid)) {
- ha_alert("Current worker %d left with exit code %d\n", exitpid, status);
+ ha_alert("Current worker %d exited with code %d\n", exitpid, status);
if (status != 0 && status != 130 && status != 143
&& !(global.tune.options & GTUNE_NOEXIT_ONFAILURE)) {
ha_alert("exit-on-failure: killing every workers with SIGTERM\n");
mworker_kill(SIGTERM);
}
} else {
- ha_warning("Former worker %d left with exit code %d\n", exitpid, status);
+ ha_warning("Former worker %d exited with code %d\n", exitpid, status);
delete_oldpid(exitpid);
}
}
--
2.15.1
Commit 4cfede87a313456fcbce7a185312460b4e1d05b7 removed
`exit-on-failure` in favor of `no-exit-on-failure`, but failed
to update references to the former in user facing messages.

This should be backported to haproxy 1.8.
---
src/cfgparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index 8486f0faa..baf9e60f7 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -742,7 +742,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
if (!strcmp(args[1], "no-exit-on-failure")) {
global.tune.options |= GTUNE_NOEXIT_ONFAILURE;
} else {
- ha_alert("parsing [%s:%d] : '%s' only supports 'exit-on-failure' option.\n", file, linenum, args[0]);
+ ha_alert("parsing [%s:%d] : '%s' only supports 'no-exit-on-failure' option.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
--
2.15.1
William,

Am 04.12.2017 um 16:09 schrieb William Lallemand:
> I prefer to leave this one, because otherwise the user won't understand why it
> killed the workers, and a grep on "exit-on-failure" in the documentation will
> find "no-exit-on-failure" so that's not a problem.
>

Okay, updated patch sent (because I was not sure whether you / Willy
would edit it yourselves or not).

Best
Tim Düsterhus
Hi guys!

On Tue, Dec 05, 2017 at 06:16:22PM +0100, Tim Düsterhus wrote:
> William,
>
> Am 04.12.2017 um 16:09 schrieb William Lallemand:
> > I prefer to leave this one, because otherwise the user won't understand why it
> > killed the workers, and a grep on "exit-on-failure" in the documentation will
> > find "no-exit-on-failure" so that's not a problem.
> >
>
> Okay, updated patch sent (because I was not sure whether you / Willy
> would edit it yourselves or not).

Now applied, thank you!

Willy
Sorry, only registered users may post in this forum.

Click here to login