Welcome! Log In Create A New Profile

Advanced

Re: Nginx patch for unexpected FASTCGI_END_REQUEST on php keep_conn + fastcgi_finish_request

Maxim Dounin
July 04, 2014 12:14PM
Hello!

On Fri, Jul 04, 2014 at 05:33:43PM +0400, Dmitry Saprykin wrote:

> Ok, quite clear. ) Just thought that in case of keepalive connection to
> FastCGI upstream we can process more than 1 request using one connect.
>
> Unexpected FCGI_END_REQUEST is received in following case:
> 1) Request 1 sent to backend, results received and sent to client
> 2) Request 2 sent to backend by nginx and is in queue because php is busy
> after fastcgi_finish_request() call
> 3) php finishes extra work after fastcgi_finish_request() call and sends
> FCGI_END_REQUEST
> 4) Nginx expects STDERR or STDOUT of request 2 but receives FCGI_END_REQUEST
> of request 1.
>
> If this situation is normal by design I will just not use keep_conn.

This situation isn't normal. It's a bug in php which sends
two FCGI_END_REQUEST records for a request - first one after
fastcgi_finish_request(), and another one once it finishes the
work. And this probably should be fixed - in php. There is
nothing to fix in nginx though.

--
Maxim Dounin
http://nginx.org/

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

Nginx patch for unexpected FASTCGI_END_REQUEST on php keep_conn + fastcgi_finish_request

Dmitry Saprykin 744 July 04, 2014 09:20AM

Re: Nginx patch for unexpected FASTCGI_END_REQUEST on php keep_conn + fastcgi_finish_request

Maxim Dounin 368 July 04, 2014 09:24AM

Re: Nginx patch for unexpected FASTCGI_END_REQUEST on php keep_conn + fastcgi_finish_request

Dmitry Saprykin 698 July 04, 2014 09:36AM

Re: Nginx patch for unexpected FASTCGI_END_REQUEST on php keep_conn + fastcgi_finish_request

Maxim Dounin 545 July 04, 2014 12:14PM



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

Online Users

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