-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Integrated fiber dumps #6152
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
Integrated fiber dumps #6152
Conversation
@@ -362,6 +363,8 @@ trait Runtime[+R] { | |||
private final def unsafeRunWith[E, A]( | |||
zio: ZIO[R, E, A] | |||
)(k: Exit[E, A] => Any)(implicit trace: ZTraceElement): FiberId => (Exit[E, A] => Any) => Unit = { | |||
val enableRoots = runtimeConfig.flags.isEnabled(RuntimeConfigFlag.EnableFiberRoots) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used for anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
d0b2099
to
fb3cd00
Compare
Fiber dumps have been integrated into Core. As part of these changes:
Fiber#children
now returns the children of the specified fiber, using the newevalOn
machinery to safely copy the contents of the weak set backing the children fibersFiber.roots
now returns the root fibers, which are those created implicitly fromRuntime#unsafeRun*
family of methodsRuntimeConfigFlag.EnableFiberRoots
can now be used to turn on or off root fiber tracking. If off, then fiber dumps won't workFiber.dump*
family of methods has been pruned and cleaned up; now only two methods exist,Fiber.dumpAllWith
, andFiber.dumpAll
.Fiber.Dump
) are no longer optional; they always appearWeakConcurrentBag
has been introduced to aid tracking root fibers. This achieves zero allocations in the happy path and allows (weakly consistent) concurrent iteration