Hi,

I think I've found a bug in core.msleep (and core.sleep);

foo.lua;

core.register_service("foo", "http", function(applet)
  core.msleep(1)
  local body = "hello"
  applet:set_status(200)
  applet:add_header("Content-Length", string.len(body))
  applet:start_response()
  applet:send(body)
end)

haproxy.cfg

global
  lua-load foo.lua

defaults
  mode http
  timeout client 150000
  timeout server 3600000
  timeout connect 5000
  timeout queue 5000

listen l
  bind 127.0.0.1:6000
  http-request use-service lua.foo

--

steps to reproduce;

curl 127.0.0.1:6000

this will not respond at all.

If you comment out the core.msleep(1) line, you get the expected 200 response.

This seems to occurs wherever core.msleep is used but I've only confirmed this 
behaviour in register_service and register_action functions.

Regards,
Robert Newson.





Reply via email to