Bug #15209 Updated: Under Apache, register_shutdown_function() broke between 4.0.x to 4.1.x
| From: | sts at mail dot xubion dot hu | Date: | Tue, 11 Jun 2002 16:38:39 +0000 |
| Subject: | Bug #15209 Updated: Under Apache, register_shutdown_function() broke between 4.0.x to 4.1.x | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10134@lists.php.net to get a copy of this message | ||
ID: 15209
Updated by: sts@mail.xubion.hu
Reported By: priebe@mi-corporation.com
Status: Open
Bug Type: Output Control
Operating System: RH Linux 7.2
PHP Version: 4.1.x - 4.2.1
New Comment:
> Generally, it's not obvious that shutdown
>functions should be executed after the connection shuts
>down.
It's not obvius, but worked (and documented?) this way
before, and some programs used this feature exstensively
(such as ours) And now we have to say to our customers
that they shouldn't upgrade from 4.0.6 if they want to use
our system. I think there are other people who have the
same situation.
Previous Comments:
------------------------------------------------------------------------
[2002-06-07 11:48:55] jtate@php.net
Then we need two functions. One for the case where we don't want to
close the connection, and one for offline processing after closing the
connection. Is there some other mechanism for offline processing? If
not do you have any ideas on how one might implement such an extension?
------------------------------------------------------------------------
[2002-06-07 11:38:48] zeev@php.net
This should be discussed. Generally, it's not obvious that shutdown
functions should be executed after the connection shuts down. It may
very well be used to print out information, which obviously cannot be
done if it's done after the user disconnects.
I believe that getting this behavior to work is only possible under
Apache. With most (all?) other server APIs, it's only possible to do
things while the user is still connected. So, if we want consistency
across web server, the existing behavior is the desired one.
------------------------------------------------------------------------
[2002-06-03 15:59:29] jtate@php.net
This bug still exists in 4.2.1 version. If it's reproduced 6/6 times
on different platforms with an average score of 4.9, it's pretty
important if not critical.
Here's a sample script:
<?PHP
function foo ()
{
sleep (10);
print "foo<BR>\n";
}
print "pre shutdown<BR>\n";
register_shutdown_function (foo);
print "shutting down<BR>\n";
?>
This should return immediately printing
pre shutdown
shutting down
but instead waits ten seconds then prints
pre shutdown
shutting down
foo
------------------------------------------------------------------------
[2002-06-03 09:46:38] priebe@mi-corporation.com
IIRC, somebody from the PHP team set the "Critical" flag after
confirming its existence. I've come to the conclusion that
register_shutdown_function() is one of the least-exercised portions of
the PHP core, based on the fact that the docs and online comments have
never mentioned the fact that it never worked under anything but
Apache+*nix.
Seems to me that the nature of the bug _is_ critical, since any
application that depends on register_shutdown_function() will fail
horribly if the call does not work.
At any rate, we will test. Thanks.
------------------------------------------------------------------------
[2002-06-03 09:38:28] mfischer@php.net
Can't be critical, no one else reported this yet.
Please test with latest Apache/PHP and see if this problem still exists
(regardless of the source in sapi_apache.c)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15209
--
Edit this bug report at http://bugs.php.net/?id=15209&edit=1