Re: Problems with dynamic reconfiguration

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 20 Dec 2007 23:16:12 +0100


On Thu, Dec 20, 2007 at 02:39:26PM -0700, Dan Zubey wrote:
> I'm having the same issue, however I'm dealing with it on production and
> trying to get more information on the problem.
>
> 1.3.13.1 seems to restart correctly, but the new version does not. I'll
> be doing more testing in the next few days to isolate the issue so I can
> report it better.

OK I have found the problem and have appended the fix. Please apply to your trees. If that's not too much annoying, I'd like to delay a bit 1.3.14.1 in order to include a good part of the doc updates I have pending, but this needs some cleanups first. Maybe this week-end will be OK. BTW, another fix is pending for the transparent proxy mode, but I know that almost nobody uses it (it requires a kernel patch) so it's not a serious issue and it will wait for 1.3.14.1 too. It's in git for those curious.

The problem was that I compared a bit-field error with a specific value. Of course that cannot work!

Regards,
Willy

From e13e9251a6db960c0db7b69107f7ea22b1c894f5 Mon Sep 17 00:00:00 2001 From: Willy Tarreau <w#1wt.eu>
Date: Thu, 20 Dec 2007 23:05:50 +0100
Subject: [BUG] hot reconfiguration failed because of a wrong error check

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 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/haproxy.c b/src/haproxy.c
index 887c162..156545d 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -851,7 +851,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;
-- 
1.5.3.4
Received on 2007/12/20 23:16

This archive was generated by hypermail 2.2.0 : 2007/12/20 23:30 CET