diff --git a/src/mworker.c b/src/mworker.c index 431935852..7d3c831c9 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -699,10 +699,27 @@ static int cli_parse_reload(char **args, char *payload, struct appctx *appctx, v struct connection *conn = NULL; int fd = -1; int hardreload = 0; + struct mworker_proc *proc; if (!cli_has_level(appctx, ACCESS_LVL_OPER)) return 1; + list_for_each_entry(proc, &proc_list, list) { + /* if there is a process with PROC_O_INIT, i.e. new worker is + * doing its init routine, block the reload + */ + if (proc->options & PROC_O_INIT) { + chunk_printf(&trash, "Success=0\n"); + chunk_appendf(&trash, "--\n"); + chunk_appendf(&trash, "Another reload is still in progress.\n"); + + if (applet_putchk(appctx, &trash) == -1) + return 0; + + return 1; + } + } + /* hard reload requested */ if (*args[0] == 'h') hardreload = 1;