]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: does not abort() in mworker_pipe_register()
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 7 Nov 2018 07:38:32 +0000 (08:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Nov 2018 08:26:36 +0000 (09:26 +0100)
The process was aborting with nbthread > 1.

The mworker_pipe_register() could be called several time in multithread
mode, we don't want to abort() there.

src/haproxy.c

index 0f593e3c6a09c0680c7524a19952019caf9fed3d..96e39be8b3d768d09c93d8b30f800e0cd25d781a 100644 (file)
@@ -2580,15 +2580,13 @@ void mworker_accept_wrapper(int fd)
 }
 
 /*
- * Should only be called once per process
  * This function register the accept wrapper for the sockpair of the master worker
  */
-
 void mworker_pipe_register()
 {
        /* The iocb should be already initialized with listener_accept */
-       if (fdtab[proc_self->ipc_fd[1]].iocb != listener_accept)
-               abort();
+       if (fdtab[proc_self->ipc_fd[1]].iocb == mworker_accept_wrapper)
+               return;
 
        fcntl(proc_self->ipc_fd[1], F_SETFL, O_NONBLOCK);
        /* In multi-tread, we need only one thread to process