From: faerion at eggdrop dot org dot ru
Operating system: Linux 2.6.15
PHP version: 5.1.2
PHP Bug Type: Other web server
Bug description: php-fastcgi + CLOSE_WAIT
Description:
------------
I use nginx+php-fastcgi under linux. My script outputs some part of file
and waits for ipc message to continue sending file. max_execution_time is
set to 0, ignore_user_abort is off. When user aborts the connection -
nginx closes client connection and connection to php-fastcgi server. But
the socket on php doesn't close and remains beeing in CLOSE_WAIT state
without any timeout. There is also no script execution break caused by
connection abort - connection_status() always returns 0. Example of
netstat output:
tcp 1 0 127.0.0.1:10000 127.0.0.1:42347
CLOSE_WAIT 29566/php
Reproduce code:
---------------
while (!$t) {
if (msg_receive($GLOBALS['stream_queue'], 1, $msg_type,
1024, $msg, true, MSG_IPC_NOWAIT)) {
$t = true;
} else {
usleep(10000);
}
}
Expected result:
----------------
That code execution should break on user abort.
Actual result:
--------------
Actually it doesn't break.
--
Edit bug report at http://bugs.php.net/?id=37256&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=37256&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=37256&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=37256&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37256&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=37256&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37256&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37256&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37256&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37256&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37256&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=37256&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=37256&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37256&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37256&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37256&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37256&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37256&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37256&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37256&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37256&r=mysqlcfg