-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
CGO Callback Runtime Error when using AMPHP in Worker Mode #1215
Comments
Edit: Error appears without worker mode too. |
Errors without worker mode: AMPHP is using fibers.. maybe that encours this errors.
|
@digitaltim-de I'm curious to look at a reproducer in any case, if you can provide it. I'm curious:
I can take a look to see if there are other incompatibilities or issues as well. We use amphp pretty extensively (and I've helped out over there -- mostly with bug/feature requests). |
Hello @withinboredom Here is a minified function of my case... its recoded and just for test test... This code delivers on a php-fpm as result null, with FrankenPHP it crashes the server. Written in Symfony as Controller:
|
Generally, you can use fibers so long as you don't output/flush anything during the fiber execution (including logs, warnings, notices, etc.), which triggers a call to go from a fiber; breaking the stack. If you remove the |
This code broke my system definitifly. I do a video for you and i post the error code here:
My Symfony is 6.4 i use the latest version of frankenphp github-error-frankenphp-error.mov |
I tried in prod mode and there i got only 1 error message but the same error:
|
What happened?
I encountered a runtime error when running FrankenPHP in worker mode alongside an endpoint that uses AMPHP. The error does not occur in non-worker mode.
Environment
FrankenPHP running in worker mode
AMPHP for asynchronous operations (similar to ReactPHP)
The affected endpoint also uses a worker-based system
Problem
All routes work perfectly except for one specific endpoint. This endpoint uses AMPHP and seems to conflict with FrankenPHP in worker mode. AMPHP itself relies on workers, and this might cause the runtime error.
Error log snippet:
Observations
The error does not happen in non-worker mode.
The problem arises only with this specific endpoint, which heavily relies on AMPHP.
I suspect the issue is related to both FrankenPHP and AMPHP using workers, leading to a conflict.
Steps to Reproduce
Run FrankenPHP in worker mode.
Set up a route that uses AMPHP for asynchronous operations.
Trigger the route and observe the runtime crash.
Expected Behavior
The endpoint should function without crashing, as it does in non-worker mode.
Additional Notes
This may be a compatibility issue between FrankenPHP and AMPHP's worker implementations. If needed, I can provide a minimal reproducible example to assist with debugging.
After the error, frankenphp stops working too and dont reload.
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
macOS
CPU Architecture
Apple Silicon
PHP configuration
Relevant log output
No response
The text was updated successfully, but these errors were encountered: