Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FrankenPHP: mutex not unlocked in zend_bailout case #313

Closed
realFlowControl opened this issue Jul 8, 2024 · 4 comments · Fixed by #314
Closed

FrankenPHP: mutex not unlocked in zend_bailout case #313

realFlowControl opened this issue Jul 8, 2024 · 4 comments · Fixed by #314
Assignees

Comments

@realFlowControl
Copy link
Collaborator

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:

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.

Relates to:

@dunglas
Copy link

dunglas commented Jul 8, 2024

Thanks, I'll try to hack Static PHP CLI to see if this fixes this issue this afternoon.

@realFlowControl
Copy link
Collaborator Author

PR #314 will unlock the mutex in RSHUTDOWN and seems to solve the problem

@dunglas
Copy link

dunglas commented Jul 8, 2024

ok, let me know when there is a branch ready with all needed patches and I'll give it a try.

@realFlowControl
Copy link
Collaborator Author

You can try the florian/deadlock-in-echo branch from #314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants