Re: Problems with dynamic reconfiguration

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 20 Dec 2007 22:26:14 +0100


Hello Justin,

On Thu, Dec 20, 2007 at 08:35:04PM +0000, Justin Santa Barbara wrote:
> I can't get dynamic reconfiguration to work. I want to add a
> webserver to the haproxy load-balancer, so I edit the config file, and
> issue a -st command. However, haproxy doesn't bring the new server
> into the rotation, no messages are logged, and essentially nothing
> happens. An exit code of 1 is returned. If I kill haproxy and
> relaunch it, the new webserver does enter the rotation, so I don't
> believe the config is to blame.
>
> I've experimented with all sorts of combinations, but I've included
> some attempts demonstrating what I'm doing at the end here - haproxy
> just seems to exit.

That's not expected, and your tests look correct. Have you tried with "-sf" instead of "-st" ? I ask this because I very rarely use "-st" so I may have introduced an undetected bug.

Also, could you run the new process through strace and post the trace ? Just use "strace -o log_file haproxy -f ..." for this.

I've just tried right now with the same binary and both -sf and -st work as expected *on my machine*. My return code is correct (0).

Uh oh... It looks like it correcly works only on my machine, as I can reproduce the problem on another one :

# ./haproxy-1.3.14-pcre-40kses-splice-linux-i586.notstripped -V -db -f test-time.cfg -st 1339 [WARNING] 001/141150 (1340) : parsing [test-time.cfg:17] : overwriting client timeout which was already specified Available polling systems :

     sepoll : pref=400,  test result OK
      epoll : pref=300,  test result OK
       poll : pref=200,  test result OK
     select : pref=150,  test result OK

Total: 4 (4 usable), will use sepoll.
Using sepoll() as the polling mechanism. root#dhcp22:tmp# echo $?
1

Hmmm the problem comes from the listeners :

socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4 fcntl64(4, F_SETFL, O_RDONLY|O_NONBLOCK) = 0

setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(4, SOL_SOCKET, 0xf /* SO_??? */, [1], 4) = -1 ENOPROTOOPT (Protocol not available)
bind(4, {sa_family=AF_INET, sin_port=htons(8000), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
close(4)                                = 0
munmap(0x6fe8e000, 4096)                = 0
_exit(1)                                = ?
Process 1342 detached

OK, I'm checking this deeper and come back to you ASAP with a fix if possible.

Regards,
Willy Received on 2007/12/20 22:26

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