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
Add a signal handler for dumping the fiber stack in zio.App #2263
Comments
Would it be possible to push this into the |
@adamgfraser The logic, for sure. It's up to the user to make sure it's only done once though. |
I'm up for implementing this 👍 |
@softinio no problem 👍 |
I missed that ticket when opening #2390, thanks @ghostdogpr for noticing! So my use case is (obviously) to allow debugging unforseen lock in production, especially if the lock happens in a condition set hard to diagnose and reproduce. Moreover, the listener for that signal might need to live in its own thread/fiber pool so that we can analyse even situation where zio-default-async is exhausted like in #2373. And it needs to be available for user which don't use App (my use case: porting an historical app to zio, with lots of call to |
Using
sun.misc.{Signal, SignalHandler}
, add a signal hander forSIGUSR1
that dumps the current fiber stack to stderr.Those classes will work for the JVM, but not for ScalaJS. Something equivalent needs to be found for ScalaJS (and it should only be registered if running under node.js).
The fiber stack can be retrieved using
Fiber.dump
andDump#prettyPrintM
.The text was updated successfully, but these errors were encountered: