Hi Marc-Antoine,
Le 12/08/2015 19:01, Marc-Antoine a écrit :
I forgot lua file content :
# cat mylua.lua
-- a simple mirror web server
-- it generates a response whose body contains the requests headers
function mirror(txn)
> (...)
txn:close()
end
This is the call which produce a segfault later, combined with the
haproxy configuration. I give more details below.
Marc-Antoine <[email protected]> wrote :
> (...)
defaults
mode http
(...)
frontend fe:80
bind 127.0.0.1:80
acl debugme req.hdr_cnt(X-debug-me) ge 1
http-request lua mirror if debugme
default_backend be
It looks that currently, mode http doesn't allow a call to txn:close().
To extend the issue, txn:close() won't work for a proxy in HTTP mode for
both :
http-request lua
tcp-request content lua
This is due to the stream processing which still execute some request
analyzers even if the lua code sends a response and asks to close the
transaction.
I haven't looked at the code enough yet, but maybe we should try to find
a way to notify haproxy to stop the processing once txn:close() is called.
This also explains some other segfaults reported in the past :
http://comments.gmane.org/gmane.comp.web.haproxy/21136
--
Cyril Bonté