Skip to content

Commit c522b52

Browse files
committed
fix: exit(), die() and uncaught exceptions must stop the worker
1 parent 9a8ad97 commit c522b52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frankenphp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,12 @@ 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)) &&
437+
!zend_is_graceful_exit(EG(exception))) {
437438
zend_exception_error(EG(exception), E_ERROR);
439+
zend_bailout();
438440
}
439441

440442
frankenphp_worker_request_shutdown();

0 commit comments

Comments
 (0)