Ciprian,

Am 21.01.2018 um 13:26 schrieb Ciprian Dorin Craciun:
> Nice little tool!

Thank you.

> Quick question though:  does this script actually block HAproxy's
> event loop while waiting for the response from the backend server?
> 
> (I've read quickly through your article describing the script, but
> failed to get a clear answer to this question.  Moreover looking at
> the script, unless HAProxy does something "funky" with the Lua
> interpreter to give the impression of a synchronous API, I would say
> it does block the HAProxy thread that calls this script.)

haproxy's Socket class is documented to be non-blocking, as explained
here: https://www.arpalert.org/haproxy-lua.html#h204 ("Non blocking
design"). Most of my article focused on getting the Socket class of
haproxy to work, instead of using the native Socket class of Lua for
that reason.

Best regards
Tim Düsterhus

Reply via email to