|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-11 20:08 UTC] e at osterman dot com
[2013-07-16 06:18 UTC] osmanov@php.net
-Status: Open
+Status: Wont fix
[2013-07-16 06:18 UTC] osmanov@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ In the test example below, if you happen to throw an uncaught Exception, the application get's stuck in an infinite loop. This is probably not the way it should work, and the dispatch method should exit with EINTR. Per the libevent library, it says dispatch can exit. "It [A callback] can return -1 to indicate an error to the event library, causing event_dispatch() to terminate with errno set to EINTR." Reproduce code: --------------- <?php dl('event.so'); event_init(); // called when user hits ^C. Should stop the dispatcher b/c no more scheduled events. function stop($sig) { global $s; global $p; echo "You got signal $sig.\n"; throw new Exception("Test Exception"); } function periodic() { print time() ."\r"; return true; } $s = event_handle_signal(2, 'stop'); event_schedule($s); $p = event_timeout('periodic', null, 0, 5000, EV_PERSIST ); event_schedule($p); echo "Going into dispatch loop: at t= " . time() . "\n"; event_dispatch(); echo "all done\n"; ?> Expected result: ---------------- The dispatch loop should terminate and the message "all done" printed out to the screen. Actual result: -------------- Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 Warning: event_dispatch(): callback failed in /tmp/t.php on line 34 ....forever