Hi Dmitry,

On Wed, Mar 15, 2017 at 12:45:54AM +0300, Dmitry Sivachenko wrote:
> I committed your patch to FreeBSD ports.

I was just reported an undesired side effect of this patch with smtp
in clear without proxy-proto :-(

The problem is that we're using the CONNECTED flag to indicate whether
we've just detected the transition from pending handshake to connected
or not. And the data layer also needs to see the transition so we can't
set it too early.

Thus in order to fix Matthias' issue I'm tempted by extending the
CONN_STATE flag to cover all handshakes, but I'm scared to break
complex health checks by calling them multiple times when multiple
layers are stacked (eg: ssl + send_proxy).

The root cause of the problem is the fact that we don't cover the
handshakes completion when deciding to wake the data layer up, and
that these ones are supposed to (sometimes) complete a connection
establishment (eg: Matthias' case where the successful connect()
didn't leave room for another event to report this).

I *think* we can use as a universal event the absence of any
handshake, any pending L4/L6 pending connection and the absence
of the CO_FL_CONNECTED flag, indicating we're just finishing a
connection validation. I need to verify if it would work both
for checks and regular connections, and on both sides, in a wide
variety of combinations. I also don't feel much confident by the
fact that the stream interface layer validates the connection
establishment without checking for pending handshakes, so such
a change requires extreme care :-/

I'm now working on this (I didn't expect to do this today) but I
already feel like I'm pulling one thread and that the whole ball
is coming with it. Let's hope that it will end up with all these
design bugs being smashed :-/

In your case, if you get bad reports it might be better to go back
to the previous package with the temporary revert. But I hope to
have good news today so that you don't have to emit two package
updates.

Regards,
Willy


Reply via email to