Welcome! Log In Create A New Profile

Advanced

Upstream error handling issue

Aviram Cohen
August 19, 2013 10:18AM
Hello!

I have encountered a potential bug in Nginx's upstream module -
When the upstream server is an SSL server, if an error occurs in
ngx_http_upstream_ssl_handshake() - the
function ngx_http_run_posted_requests() is never called.
This happens when initiating an SSL connection, the SSL module handles the
handshake, and not the upstream module (meaning ngx_http_upstream_handler()
is not involved in the process), and so if an error occurs, there's no one
who calls ngx_http_run_posted_requests().

The effect of this issue is the requests that "spawn" subrequests that use
the upstream error get stuck in case of an SSL error.
I can suggest two possible fixes (in the file ngx_http_upstream.c):
- Add a call to ngx_http_run_posted_requests() to the end
of ngx_http_upstream_finalize_request().
- Add a call to ngx_http_run_posted_requests() after calling
ngx_http_upstream_finalize_request() during error handling of the SSL
connection establishment.

Can anyone verify this issue and the suggested solution? If so, I'll be
more than happy to submit a patch.

Best regards,
Aviram
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Upstream error handling issue

Aviram Cohen 761 August 19, 2013 10:18AM

Re: Upstream error handling issue

Maxim Dounin 359 August 19, 2013 11:18AM

Re: Upstream error handling issue

Aviram Cohen 368 August 19, 2013 11:38AM

Re: Upstream error handling issue

Maxim Dounin 491 August 19, 2013 12:04PM



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

Online Users

Guests: 176
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