Welcome! Log In Create A New Profile

Advanced

Fwd: Problems with SSL + SPDY cause CLOSE_WAIT connections

Salvador Gironès Gil
September 10, 2013 07:02AM
Hi,

I know this appeared some time ago with first versions of SPDY, but we have
been using 1.4.1 SPDY in production and it is generating lots of CLOSE_WAIT
connections.

Doing some testing, I found reproducible steps and a possible patch.

Our env (listing what I think are relevant points, please ask for more if
you need it):
1. Nginx 1.4.1
2. SSL + SPDY
3. Proxy-pass 443 port to a Rails app
3. Sendfile on

Steps to reproduce:
1. Perform a POST with a big body (I'm uploading a file)
2. Refresh the browser before the upload finishes
3. Close the browser

When the connection is closed due the browser close, the error.log (with
debug enabled) says:
*2013/09/10 10:02:53 [info] 4372#0:* *12 client closed prematurely
connection while processing SPDY, client: 1.2.3.4, server: 0.0.0.0:443
*2013/09/10 10:02:53 [debug] 4372#0:* *12 http reading blocked

And nothing else happens.

I tried to add a connection check inside *ngx_http_block_reading *based on *
ngx_http_test_reading:*

>
#if (NGX_HTTP_SPDY)

if (r->spdy_stream) {

if (c->error) {
err = 0;

goto closed;
}

return;
}
#endif

I'm checking if the spdy_stream is open before trying to read from it. It
converts the CLOSE_WAIT connections to TIME_WAIT and they do finalize after
some seconds.

I dig into nginx code yesterday, so I'm far from correctly understand where
the real problem is, but this "patch" seems reasonable to me.

Can someone with better nginx source code understanding, provide some
feedback?

And thanks for all your work!
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Fwd: Problems with SSL + SPDY cause CLOSE_WAIT connections

Salvador Gironès Gil 1128 September 10, 2013 07:02AM

Re: Fwd: Problems with SSL + SPDY cause CLOSE_WAIT connections

Valentin V. Bartenev 494 September 10, 2013 10:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 153
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready