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

Stacktrace of exception thrown in workers is not logged #9

Open
vfsoraki opened this issue Feb 2, 2021 · 1 comment
Open

Stacktrace of exception thrown in workers is not logged #9

vfsoraki opened this issue Feb 2, 2021 · 1 comment

Comments

@vfsoraki
Copy link

vfsoraki commented Feb 2, 2021

When an exception is thrown in worker, only the message and code of exception is logged.

A stacktrace is logged, but it is the stacktrace of Process and its state, not the actual stacktrace of exception.

Example:

[2021-02-02T14:15:37.836279+00:00] cluster-86033.error: Worker 2 failed: Amp\Parallel\Sync\ContextPanicError: Uncaught Error in child process or thread with message "Call to a member function get() on null" and code "0"; use Amp\Parallel\Sync\ContextPanicError::getOriginalTrace() for the stack trace in the child process or thread in /<project-path>/vendor/amphp/parallel/lib/Sync/ExitFailure.php:46

This exception causes my workers to die (not a bug with Cluster, bug from my code). But logged error does not help at all. I had to to the classical dump&die starting from worker script to find out where was the error.

Is this expected behavior? Am I missing something?

My worker code is pretty much like HTTP server example from this repo.

I'm willing to look into it, if this is an issue.

@vfsoraki
Copy link
Author

vfsoraki commented Feb 2, 2021

As a note, the bug in my code happened before loop is actually started.

Maybe that is the reason the exception is not logged properly.

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

No branches or pull requests

1 participant