On Tue, Nov 06, 2018 at 07:13:26PM +0100, PiBa-NL wrote:
> Hi William,
> 
> Something seems to have been broken by below patch series. (when using 
> threads.?.)
> 
> ***  h1    0.0 debug|[ALERT] 309/191142 (6588) : Current worker #1 
> (6589) exited with code 134 (Abort trap)
> ***  h1    0.0 debug|[ALERT] 309/191142 (6588) : exit-on-failure: 
> killing every workers with SIGTERM
> 
> Yes i'm using -W in the varnishtest, and yes that adds a 1 second delay 
> or something, but that never prevented this test from succeeding for me 
> before..
> 
> Can you take a look?
> 
> Regards,
> PiBa-NL (Pieter)
> 

Oh that's funny, the mworker_pipe_register() was supposed to be called
once per process, that's why I put an abort() there, but that's not the case
anymore with nbthread.

Thanks Pieter.

Patch attached.

-- 
William Lallemand
>From 679ac745d33f9806dc9dca83937432da7f23df62 Mon Sep 17 00:00:00 2001
From: William Lallemand <wlallem...@haproxy.com>
Date: Wed, 7 Nov 2018 08:38:32 +0100
Subject: [PATCH] BUG/MEDIUM: mworker: does not abort() in
 mworker_pipe_register()

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 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/haproxy.c b/src/haproxy.c
index 0f593e3c6..96e39be8b 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -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
-- 
2.16.4

Reply via email to