#40556 [Opn->Asn]: Browser abort causes server hang with FastCGI

From: Date: Tue, 20 Feb 2007 12:52:02 +0000
Subject: #40556 [Opn->Asn]: Browser abort causes server hang with FastCGI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109171@lists.php.net to get a copy of this message
ID: 40556 Updated by: tony2001@php.net Reported By: unreal at slashorg dot net -Status: Open +Status: Assigned Bug Type: CGI related Operating System: Linux 2.6.18 PHP Version: 5.2.1 -Assigned To: +Assigned To: dmitry Previous Comments: ------------------------------------------------------------------------ [2007-02-20 12:48:13] unreal at slashorg dot net I've just upgraded to 5.2.2-dev as you suggested, and that hasn't fixed the problem. My server is still dying as soon as a connection gets aborted. ------------------------------------------------------------------------ [2007-02-20 12:14:53] tony2001@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip ------------------------------------------------------------------------ [2007-02-20 12:10:10] unreal at slashorg dot net Description: ------------ PHP doesn't handle browser abort correctly. - Use PHP to serve a file, using the code below - Start downloading the file, and then abort. Reproduce code: --------------- header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: public'); header('Content-Type: application/force-download'); header('Content-Type: application/octet-stream'); header('Content-Type: application/download'); header('Content-Disposition: attachment; filename="' . basename($path) . '";'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($path)); $handle = fopen($path, 'rb'); do { $data = fread($handle, 8192); if (strlen($data) == 0) { break; } echo($data); } while (true); fclose($handle); Expected result: ---------------- After browser abord, the server should remain responsive. Actual result: -------------- * Lots of errors in error_log: 'FastCGI: comm with server "/usr/local/www/cgi/php-cgi/php5.fcgi" aborted: idle timeout (30 sec)' 'FastCGI: incomplete headers (0 bytes) received from server "/usr/local/www/cgi/php-cgi/php5.fcgi"' * Server stops responding, then after some time (maybe 5 mins), starts responding again. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40556&edit=1

« previous php.bugs (#109171) next »