8000 Integrated fiber dumps by jdegoes · Pull Request #6152 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 22 commits into from
Dec 14, 2021
Merged

Integrated fiber dumps #6152

merged 22 commits into from
Dec 14, 2021

Conversation

jdegoes
Copy link
Member
@jdegoes jdegoes commented Dec 11, 2021

Fiber dumps have been integrated into Core. As part of these changes:

  • Fiber#children now returns the children of the specified fiber, using the new evalOn machinery to safely copy the contents of the weak set backing the children fibers
  • Fiber.roots now returns the root fibers, which are those created implicitly from Runtime#unsafeRun* family of methods
  • RuntimeConfigFlag.EnableFiberRoots can now be used to turn on or off root fiber tracking. If off, then fiber dumps won't work
  • Fiber.dump* family of methods has been pruned and cleaned up; now only two methods exist, Fiber.dumpAllWith, and Fiber.dumpAll.
  • Stack traces in fiber dumps (Fiber.Dump) are no longer optional; they always appear
  • Dead code has been deleted
  • A WeakConcurrentBag has been introduced to aid tracking root fibers. This achieves zero allocations in the happy path and allows (weakly consistent) concurrent iteration
  • Fiber dumps can be triggered locally by SIGINT (Windows) or SIGINFO / SIGUSR1 (elsewhere); signals are emulated on Scala.js by URL hash changes (e.g. zio-signal=INFO in hash).

@@ -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)
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@jdegoes jdegoes closed this Dec 13, 2021
@jdegoes jdegoes reopened this Dec 13, 2021
adamgfraser
adamgfraser previously approved these changes Dec 13, 2021
Copy link
Contributor
@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jdegoes jdegoes closed this Dec 13, 2021
@jdegoes jdegoes reopened this Dec 13, 2021
vigoo
vigoo previously approved these changes Dec 13, 2021
@jdegoes jdegoes closed this Dec 13, 2021
@jdegoes jdegoes reopened this Dec 13, 2021
@jdegoes jdegoes force-pushed the fiber-dumps branch 2 times, most recently from d0b2099 to fb3cd00 Compare December 14, 2021 09:02
@jdegoes jdegoes closed this Dec 14, 2021
@jdegoes jdegoes reopened this Dec 14, 2021
@jdegoes jdegoes closed this Dec 14, 2021
@jdegoes jdegoes reopened this Dec 14, 2021
@jdegoes jdegoes merged commit 919b5f8 into zio:series/2.x Dec 14, 2021
@jdegoes jdegoes deleted the fiber-dumps branch December 14, 2021 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0