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

Inconsistent Behavior in Providing/Bootstrapping Runtime Layers #9704

Open
khajavi opened this issue Mar 17, 2025 · 2 comments
Open

Inconsistent Behavior in Providing/Bootstrapping Runtime Layers #9704

khajavi opened this issue Mar 17, 2025 · 2 comments

Comments

@khajavi
Copy link
Member

khajavi commented Mar 17, 2025

When I enable the WindDown runtime flag, the following snippet code works properly and is never interrupted:

object WindDownModeExample1 extends ZIOAppDefault {
  def run = {
    for {
      f <- ZIO.never.fork
      _ <- f.interrupt
    } yield ()
  }.provide(
    Runtime.enableFlags(RuntimeFlag.WindDown)
  )
}

But when I enable it through the bootstrap layer, it will be interrupted!

object WindDownModeExample2 extends ZIOAppDefault {
  override val bootstrap =
    Runtime.enableFlags(RuntimeFlag.WindDown)

  def run =
    for {
      f <- ZIO.never.fork
      _ <- f.interrupt
      _ <- f.join
    } yield ()
}
@hearnadam
Copy link
Collaborator

@khajavi you don't join in the first example?

@khajavi
Copy link
Member Author

khajavi commented Mar 18, 2025

@hearnadam That is not important! I tried joining, but the issue persists.

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

No branches or pull requests

2 participants