Issue using ngx.location.capture in Lua Module

agentzh agentzh at gmail.com
Sat Jan 7 11:24:33 UTC 2012


On Fri, Jan 6, 2012 at 7:01 PM, Legrand Jérémie
<jeremie.legrand at atos.net> wrote:
>
> When I start the nginx server and request something, the lua script does
> correctly the memcache subrequest but I get this message for the postgres
> subrequest :
>
> [error] 24631#0: *28 postgres: connection failed: could not send startup
> packet: Resource temporarily unavailable
>

Which operating system are you using? I'm guessing you're using the
epoll events on Linux with nginx stable versions, no?

If you're using epoll on Linux, then it's a known issue that nginx's
epoll module could produce stale write events in current stable branch
(which has been fixed in the latest 1.1.x devel branch). During the
meantime, you can try applying the patch here:

https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.10-epoll_check_stale_wev.patch

It should be applied cleanly to 1.0.11 as well.

The real cause of this issue is that PostgreSQL's libpq library is
*very* sensitive to stale write events while sending its startup
packets. Fixing the stale write event handling in nginx's epoll module
can work around it.

If you're not using epoll or even not on Linux, please let us know :)

Regards,
-agentzh



More information about the nginx-devel mailing list