Skip to content

Commit 0ef4582

Browse files
committed
fix: exit(), die() and uncaught exceptions must stop the worker
1 parent bf5c984 commit 0ef4582

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

frankenphp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,11 @@ PHP_FUNCTION(frankenphp_handle_request) {
431431

432432
/*
433433
* If an exception occurred, print the message to the client before
434-
* closing the connection
434+
* closing the connection and bailout.
435435
*/
436-
if (EG(exception)) {
436+
if (EG(exception) && !zend_is_unwind_exit(EG(exception)) && !zend_is_graceful_exit(EG(exception))) {
437437
zend_exception_error(EG(exception), E_ERROR);
438+
zend_bailout();
438439
}
439440

440441
frankenphp_worker_request_shutdown();

0 commit comments

Comments
 (0)