Closed realFlowControl closed 3 days ago
Thanks, I'll try to hack Static PHP CLI to see if this fixes this issue this afternoon.
PR #314 will unlock the mutex in RSHUTDOWN
and seems to solve the problem
ok, let me know when there is a branch ready with all needed patches and I'll give it a try.
You can try the florian/deadlock-in-echo
branch from #314
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: