]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua: schedule socket task upon lua connect()
authorPiBa-NL <PiBa.NL.dev@gmail.com>
Sat, 5 May 2018 21:51:42 +0000 (23:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 6 May 2018 12:36:41 +0000 (14:36 +0200)
commit706d5ee0c366787536213ccd6dea264d20b76a22
tree13ec0e111e65d37fcd3f3ed6cb83a4f768f5845f
parentcb92f5cae4491f7e7c5b2ec8d83003f2d32cf46e
BUG/MINOR: lua: schedule socket task upon lua connect()

The parameters like server-address, port and timeout should be set before
process_stream task is called to avoid the stream being 'closed' before it
got initialized properly. This is most clearly visible when running with
tune.lua.forced-yield=1.. So scheduling the task should not be done when
creating the lua socket, but when connect is called. The error
"socket: not yet initialised, you can't set timeouts." would then appear.

Below code for example also shows this issue, as the sleep will
yield the lua code:
  local con = core.tcp()
  core.sleep(1)
  con:settimeout(10)
src/hlua.c