Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Upstream: Add "before_send" option to the 'proxy_next_upstream'.

Tolga Ceylan
February 22, 2016 06:36PM
On Fri, Feb 19, 2016 at 8:21 AM, Yusuke Nojima <nojima@ynojima.com> wrote:
> diff -r 5dfc63c1d9ca -r 88bbee2e18f6 src/http/ngx_http_upstream.c
> --- a/src/http/ngx_http_upstream.c Thu Feb 18 15:49:11 2016 +0300
> +++ b/src/http/ngx_http_upstream.c Fri Feb 19 15:48:40 2016 +0000
> @@ -3872,11 +3872,15 @@
> }
>
> if (status) {
> + int matches_next_condition = u->conf->next_upstream & ft_type;
> + if (u->conf->next_upstream & NGX_HTTP_UPSTREAM_FT_BEFORE_SEND)
> + matches_next_condition |= !u->request_sent;
> +
> u->state->status = status;
> timeout = u->conf->next_upstream_timeout;
>
> if (u->peer.tries == 0
> - || !(u->conf->next_upstream & ft_type)
> + || !matches_next_condition
> || (u->request_sent && r->request_body_no_buffering)
> || (timeout && ngx_current_msec - u->peer.start_time >= timeout))
> {

Hi All,

The patch seems to address an important issue, however one of the
conditions in the above if
statement is:

> || (u->request_sent && r->request_body_no_buffering)

which should guarantee that the request can be sent again *only* if
it's not already sent.

I easily understand "request_sent" flag here, but inclusion of
"request_body_no_buffering" flag seems wrong.

"request_body_no_buffering" seems to be flag to manage early/buffered
reads and I can't determine
why it's relevant at all here.

In other words, instead of this patch, shouldn't we modify that line as below?

> || u->request_sent

Regards,
Tolga Ceylan

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

[PATCH] Upstream: Add "before_send" option to the 'proxy_next_upstream'.

Yusuke Nojima 1291 February 19, 2016 11:22AM

Re: [PATCH] Upstream: Add "before_send" option to the 'proxy_next_upstream'.

Tolga Ceylan 521 February 22, 2016 06:36PM



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

Online Users

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