Klaus Demo nginx / 8536fb7
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. Maxim Dounin 8 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
20172017
20182018 if (rev->timedout) {
20192019 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
2020 ngx_http_upstream_finalize_request(r, u, NGX_ETIMEDOUT);
2020 ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
20212021 return;
20222022 }
20232023
25132513
25142514 if (upstream->read->timedout || upstream->write->timedout) {
25152515 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
2516 ngx_http_upstream_finalize_request(r, u, 0);
2516 ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
25172517 return;
25182518 }
25192519
27002700
27012701 if (c->read->timedout) {
27022702 ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
2703 ngx_http_upstream_finalize_request(r, u, 0);
2703 ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
27042704 return;
27052705 }
27062706