open socket left in connection

Maxim Dounin mdounin at mdounin.ru
Thu Sep 27 10:04:17 UTC 2012


Hello!

On Wed, Sep 26, 2012 at 11:37:31AM -0700, raylu wrote:

> We run nginx in front of a python app through proxy_pass. Occasionally,
> we update the configuration and reload/hup the nginx master. Sometimes,
> we see a line in the error.log like
> 
> 2012/08/08 02:21:31 [alert] 7153#0: open socket #10 left in connection 5
> 
> I see src/os/unix/ngx_process_cycle.c outputs this inside
> ngx_worker_process_exit() but I don't understand the check that it's
> doing before hand. Can someone explain what is going on when this line
> gets output?

It checks if all the sockets are properly closed on process 
shutdown (except ones which are expected to be left open, e.g.  
listening sockets).  If there are sockets which aren't closed - it 
will complain with the message in question.  This basically means 
socket leak somewhere.
  
If you see this message with recent nginx without 3rd party 
modules - you may want to provide more info.  Some useful tips how 
to debug this may be found here on wiki:

http://wiki.nginx.org/Debugging#Socket_leaks

-- 
Maxim Dounin
http://nginx.com/support.html



More information about the nginx mailing list