Issue using ngx.location.capture in Lua Module

Legrand Jérémie jeremie.legrand at
Tue Jan 10 15:23:40 UTC 2012

Thanks agentzh for your answer. I was exactly in the use case you described.

The patch worked perfectly for me. I hope it will be added to the next NGINX stable version.

J. Legrand

On Fri, Jan 6, 2012 at 7:01 PM, Legrand Jérémie
<jeremie.legrand at<>> 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:

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 :)



Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité d'Atos ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list