Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: NGX_HTTP_GATEWAY_TIME_OUT after upstream timeo...

Maxim Dounin
July 25, 2013 08:00AM
details: http://hg.nginx.org/nginx/rev/1ccdda1f37f3
branches:
changeset: 5296:1ccdda1f37f3
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Jul 25 14:56:20 2013 +0400
description:
Upstream: NGX_HTTP_GATEWAY_TIME_OUT after upstream timeouts.

There is no real difference from previously used 0 as NGX_HTTP_* will
become 0 in ngx_http_upstream_finalize_request(), but the change
preserves information about a timeout a bit longer. Previous use of
ETIMEDOUT in one place was just wrong.

Note well that with cacheable responses there will be a difference
(code in ngx_http_upstream_finalize_request() will store the error
in cache), though this change doesn't touch cacheable case.

diffstat:

src/http/ngx_http_upstream.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2018,7 +2018,7 @@ ngx_http_upstream_process_body_in_memory

if (rev->timedout) {
ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
- ngx_http_upstream_finalize_request(r, u, NGX_ETIMEDOUT);
+ ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
return;
}

@@ -2514,7 +2514,7 @@ ngx_http_upstream_process_upgraded(ngx_h

if (upstream->read->timedout || upstream->write->timedout) {
ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
- ngx_http_upstream_finalize_request(r, u, 0);
+ ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
return;
}

@@ -2701,7 +2701,7 @@ ngx_http_upstream_process_non_buffered_u

if (c->read->timedout) {
ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
- ngx_http_upstream_finalize_request(r, u, 0);
+ ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
return;
}


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

[nginx] Upstream: NGX_HTTP_GATEWAY_TIME_OUT after upstream timeo...

Maxim Dounin 726 July 25, 2013 08:00AM



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

Online Users

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