On Thu, Apr 13, 2017 at 01:17:07PM +0200, Christopher Faulet wrote:
> The hello-handshake is done only once, when a new connection with a SPOA is
> opened. But we can improve the SPOP by adding a new frame type to handle
> admin tasks (like graceful stop). This way, for a specific connection, it
> would be possible to wait for last ACK frames without sending new frames to
> the SPOA. Then stopping the SPOA listeners to let the SPOP health check
> failed should do the trick, I guess.

For this you need a "closing" state for your connections, where you know
they are not eligible to new requests. That's pretty much similar to what
we do by setting a server weight to zero in HTTP load balancing.

But such transient states for connections can quickly become tricky to
handle. The first thing is that you want to be sure that the replacement
process is ready or the agent has reported a zero weight before starting
to notify about the closing state, otherwise you'll end up with single-
request connections that quickly pile up and can even take CPU if they're
made over SSL. And it's very important not to conflate the agent state
with the connection state and to avoid reporting the agent state inside
existing connections. The problem when doing this precisely is during
reloads where both old and new connections coexist and report conflicting
information. That's why health checks and/or agent checks are much better
to get the active SPOA health. 

For example the agent's health and willingness to accept new connections
could be reported during the handshake. This way a health check can be
developped for this and there's no risk that such information could be
misreported later and cause trouble.

Willy

Reply via email to