Welcome! Log In Create A New Profile

Advanced

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin
March 19, 2013 10:56AM
Hello!

On Tue, Mar 19, 2013 at 03:45:10PM +1100, Robert Mueller wrote:

>
> > > When an https client drops it's connection, the upstream http proxy
> > > connection is not dropped. If nginx can't detect an https client
> > > disconnect properly, that must mean it's leaking connection information
> > > internally doesn't it?
> >
> > No. It just can't say if a connection was closed or not as there
> > are pending data in the connection, and it can't read data (there
> > may be a pipelined request). Therefore in this case, being on the
> > safe side, it assumes the connection isn't closed and doesn't try
> > to abort upstream request.
>
> Oh right I see now.
>
> So the underlying problem is that the nginx stream layer abstraction
> isn't clean enough to handle low level OS events and then map them
> through the SSL layer to read/write/eof conceptual events as needed.
> Instead you need an OS level "eof" event, which you then assume maps
> through the SSL abstraction layer to a SSL stream eof event.

Not exactly. The underlying problem is that BSD sockets API
doesn't provide standard means to detect EOF without reading all
pending data, and hence OS-specific extensions have to be used to
reliably detect pending EOFs.

> Ok, so I had a look at the kqueue eof handling, and what's needed for
> epoll eof handling, and created a quick patch that seems to work.
>
> Can you check this out, and see if it looks right. If so, any chance you
> can incorporate it upstream?
>
> http://robm.fastmail.fm/downloads/nginx-epoll-eof.patch
>
> If there's anything you want changed, let me know and I'll try and fix
> it up.

I don't really like what you did in ngx_http_upstream.c. And
there are more places where ev->pending_eof is used, and probably
at least some of these places should be adapted, too.

Additionally, poll_ctl(2) manpage claims the EPOLLRDHUP only
available since Linux 2.6.17, and this suggests it needs some
configure tests/conditional compilation.

Valentin is already worked on this, and I believe he'll be able to
provide a little bit more generic patch.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Dropped https client connection doesn't drop backend proxy_pass connection

Robert Mueller March 15, 2013 12:24AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin March 15, 2013 04:12AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Robert Mueller March 15, 2013 06:34PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin March 16, 2013 07:50PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Robert Mueller March 19, 2013 12:46AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin March 19, 2013 10:56AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Robert Mueller March 19, 2013 09:08PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Lintao L. June 26, 2013 10:48PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Robert Mueller July 08, 2013 10:54PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin July 09, 2013 08:10AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Robert Mueller July 22, 2013 08:08PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin July 23, 2013 12:12PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Peter B. May 12, 2014 06:48PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Valentin V. Bartenev May 13, 2014 03:52AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Peter B. May 13, 2014 10:20AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

newnovice May 16, 2014 06:32PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Valentin V. Bartenev May 17, 2014 05:44AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

newnovice May 17, 2014 11:28AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Valentin V. Bartenev May 19, 2014 10:48AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Demetr May 19, 2014 11:12AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

newnovice May 19, 2014 05:32PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Valentin V. Bartenev May 20, 2014 01:00AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

newnovice May 20, 2014 02:04AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

dgobaud July 13, 2015 12:02PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Valentin V. Bartenev July 14, 2015 09:26AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

dgobaud July 14, 2015 11:50AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

dgobaud July 14, 2015 12:43PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

Maxim Dounin July 14, 2015 01:38PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

dgobaud July 15, 2015 07:04AM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

tdavis January 27, 2016 11:16PM

Re: Dropped https client connection doesn't drop backend proxy_pass connection

dgobaud January 28, 2016 01:59AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready