-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
[💡 FEATURE REQUEST]: Improve clarity of worker errors when starting a server #2020
Comments
Hey @Kaspiman 👋
This is kind of strange, because EOF usually indicates a startup problem. When RR is running, this is highly unlikely to see this error. If you don't move the worker and send a ./rr reset command.
RR uses stdin/stdout to communicate with the PHP process. STDERR used to obtain logs/diagnostic information from the PHP process. |
It would be nice if you attach to the ticket some examples of PHP workers + actual error messages + desired error messages + .rr.yaml configurations. |
Use Case №1: Any broken php worker, for example with syntax error.
Actual error:
Desired error message with error level: Now this trace is visible only from the Logs with
Basically, we need to log the worker output at the error level unless otherwise stated. Use Case №2: debug = true and any broken php worker, for example with syntax error.
Logs:
The server has started, and when processing one request, two EOF errors are written to the logs. Error 500 and EOF message in browser. Desired error message in logs with error level: Desired error message in browser: |
Is it possible to rework this kind of error? Typical error:
It contains a lot of information that is more useful to the developer than to the user. Possible rework:
|
Ok, so, if I understand correctly, the problem is in log level, because under the |
The actual problem here, is that we don't have a log level from PHP. Thus, all worker-related messages (RR can't distinguish between a just message and an error message, from the RR POV all that is text) are logged under the A real solution I want to see here is a some configuration exchange from the PHP worker side to RR. Like in the Temporal plugin. RR on the init stage pings all workers, so it would be nice to exchange a configuration info between RR <-> PHP. Logging configuration is the first and obvious step. |
Is it possible to read all logs from an application with an error level if a specific level is not specified? This will also help in other cases, for example, when the output is erroneously sent to stdout. |
This is not a proper solution to a problem. Worker's log level should be passed from the PHP Worker, otherwise - that particular worker should be treated as invalid and re-created. |
This problem may not only be in the worker. What if someone has their own worker, and not the one offered by Spiral? What if it is a script launched in the Service plugin or in the server.on_init section? We won't be able to set up a worker there, it simply doesn't exist. I think it's possible to interpret any output from the worker as an error. This will force people to catch errors and use the Logs plugin. |
We do not support third-party workers. But all needs should be covered by the well-defined protocol. And from this point it doesn't actually matters, who created a worker.
This is possible, but logs are a very sensitive topic. And this topic should be well-discussed. |
So, let's discuss with community. Discord or https://github.com/orgs/roadrunner-server/discussions? |
Could you please provide more accurate description of that exchange? What should do PHP worker in startup phrase? |
Just a structure with some fields. Like version, desired log level and that's it at the moment I guess. You may take a look at the temporal PHP worker and |
Plugin
Server
I have an idea!
When my newbie was getting used to the RR, some problems arose that were difficult to diagnose.
Let's say i have typical RR config for production usage for Logs plugin:
and also a broken worker with a syntax error (for example).
Then the output will only include the
EOF
error without any details.A newbie has questions: why the server won't start and what is EOF?
The problem is that errors from the worker only come from the debug level. In production mode, it is difficult to immediately understand what happened. EOF is too unclear a reason. Also, an error in the EOF text was sent to the browser without any details.
What if RR write a more meaningful error message right away? It seems that the worker startup error should be more understandable and the
error
level should be.Another small question. Do RR really use STDERR to exchange data frames?
https://docs.roadrunner.dev/docs/php-worker/worker#communication-methods
The text was updated successfully, but these errors were encountered: