Hi,
I think I've come across a bug when using the ngx.timer.at api alongside coroutines and cosockets.
HUPing openresty doesn't prematurely run the callback, the worker waits until the timer expires and then runs with the premature arg set to true.
You also get the "lua pending timer counter got out of sync" error message.
It seems if you interact with a socket connection in a coroutine, put it into the keepalive pool and create a callback with ngx.timer.at in the same request then it isn't prematurely aborted by a HUP.
Here's a minimal config to reproduce the issue: https://gist.github.com/hamishforbes/8619202
Calling close on the socket, doing this without coroutines in the mix or waiting until the keepalive timeout has expired doesn't have the same issue.
Thanks!
Hamish