Hi Willy,

Le 22/08/2018 à 05:42, Willy Tarreau a écrit :
On Wed, Aug 22, 2018 at 04:32:49AM +0200, Willy Tarreau wrote:
Excellent, I think I found it :

                 trash.data = recv(conn->handle.fd, trash.area, trash.size,
                                  MSG_PEEK);
                 if (trash.data < 0) {
                         if (errno == EINTR)
                                 continue;
                         if (errno == EAGAIN) {
                                 fd_cant_recv(conn->handle.fd);
                                 return 0;
                         }
                        ...

trash.data is a size_t now so it cannot be negative. Thus it's believed
that recv() never fails. This it's clearly related to the buffer changes.
I'm seeing a few other such places that require using an intermediate
variable for the test. After all it's not that bad because we've inherited
such assignments from a good decade, and it's time to clean this up as well.

So I've now addressed all those I could find (quite a bunch in fact).
I think everything's OK now regarding this. I haven't checked for the
capture yet but since it was already broken in 1.6, it can still wait
a bit ;-)

Great job ! I can't reproduce the issue anymore, even with nbthread > 1 (I noticed too late it was easier to trigger). We can consider this as fixed ;-)
I'll upgrade the haproxy instance on my test server in the morning.

--
Cyril Bonté

Reply via email to