You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parallel replaces the sapi_module.ub_write function with a simple function that locks a mutex, calls whatever was in that function pointer before and upon return unlocks the mutex again. This hanging/freezing happens in the following situation:
a thread does echo/printf/...
parallel locks a mutex and calls frankenphp_ub_write()
go_ub_write() returns an error for a closed connection (this is an assumption)
the call will never return and the mutex wont be unlocked
The mutex around echo/printf is necessary to make them atomic from a PHP user land perspective. I'll have a look if I can detect a zend_bailout() somehow and release the mutex parallel holds.
parallel
replaces thesapi_module.ub_write
function with a simple function that locks a mutex, calls whatever was in that function pointer before and upon return unlocks the mutex again. This hanging/freezing happens in the following situation:echo
/printf
/...
frankenphp_ub_write()
go_ub_write()
returns an error for a closed connection (this is an assumption)php_handle_aborted_connection()
https://github.com/dunglas/frankenphp/blob/ebdb2656b6d8af3e0e8aa96359b02dba013ab88c/frankenphp.c#L509ignore_user_abort
is set tofalse
(default) which will lead to a call tozend_bailout()
in https://github.com/php/php-src/blob/70861c82df7ff944090a771cc40698d2cd7bd164/main/main.c#L2591The mutex around
echo
/printf
is necessary to make them atomic from a PHP user land perspective. I'll have a look if I can detect azend_bailout()
somehow and release the mutexparallel
holds.Relates to:
The text was updated successfully, but these errors were encountered: