fix: exit(), die() and uncaught exceptions must stop the worker

This commit is contained in:
Kévin Dunglas
2025-05-20 16:42:51 +02:00
parent 9a8ad979e0
commit c522b52804

View File

@@ -431,10 +431,12 @@ PHP_FUNCTION(frankenphp_handle_request) {
/* /*
* If an exception occurred, print the message to the client before * If an exception occurred, print the message to the client before
* closing the connection * closing the connection and bailout.
*/ */
if (EG(exception)) { if (EG(exception) && !zend_is_unwind_exit(EG(exception)) &&
!zend_is_graceful_exit(EG(exception))) {
zend_exception_error(EG(exception), E_ERROR); zend_exception_error(EG(exception), E_ERROR);
zend_bailout();
} }
frankenphp_worker_request_shutdown(); frankenphp_worker_request_shutdown();