From b4d23ce7bfa9dcce0e16e3c9e448324fdc0b5141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 20 May 2025 16:42:51 +0200 Subject: [PATCH] fix: exit(), die() and uncaught exceptions must stop the worker --- frankenphp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frankenphp.c b/frankenphp.c index 551bd53ed6..041e9805ae 100644 --- a/frankenphp.c +++ b/frankenphp.c @@ -431,10 +431,12 @@ PHP_FUNCTION(frankenphp_handle_request) { /* * 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_bailout(); } frankenphp_worker_request_shutdown();