]> git.kaiwu.me - haproxy.git/commitdiff
[BUG] hot reconfiguration failed because of a wrong error check
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Dec 2007 22:05:50 +0000 (23:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 20 Jan 2008 23:27:19 +0000 (00:27 +0100)
The error check in return of start_proxies checked for exact ERR_RETRYABLE
but did not consider the return as a bit field. The function returned both
ERR_RETRYABLE and ERR_ALERT, hence the problem.

src/haproxy.c

index 1108ea994c770a906e5321f9bcb6d4a1f0582c88..474878688b4e99f051e4df2b8af72388ee44da27 100644 (file)
@@ -817,7 +817,8 @@ int main(int argc, char **argv)
        while (retry >= 0) {
                struct timeval w;
                err = start_proxies(retry == 0 || nb_oldpids == 0);
-               if (err != ERR_RETRYABLE)
+               /* exit the loop on no error or fatal error */
+               if ((err & (ERR_RETRYABLE|ERR_FATAL)) != ERR_RETRYABLE)
                        break;
                if (nb_oldpids == 0)
                        break;