Ross A. Baker

Results 574 comments of Ross A. Baker

Thanks! I've been a little queasy about `Trace[IO]`, and this makes me much more queasy. `IOLocal` values are visible on the fiber we set them, and are passed to any...

Tracing resources with `IOLocal` seems ... pretty good? I posted a [full gist](https://gist.github.com/rossabaker/b3cd22845f4f72cb6af0b7978c872cd9), but the intersting bits are: ```scala trace.use { implicit trace => def io(name: String): IO[Unit] = trace.span(name)(...

It calls this: ``` private[fs2] def mapOutput[F[_], O, P](s: Stream[F, O], f: O => P): Pull[F, P, Unit] = interruptScope(mapOutputNoScope(s, f)) ``` And when I reimplement `mapOutputNoScope`, it's fine. `interruptScope`...

`stream.interruptScope.compile.drain` does it. I can confirm that it's releasing resources in the reverse order they're acquired, but the child is not seeing the same `IOLocal` state as the parent. I...

What region of the stream would have to be non-interruptible? The `spanS` effects that set the local state, or everything inside `spanS`? ```scala def spanS[F[_]: MonadCancelThrow: Trace](name: String) = //...

And modifications to the parent fiber aren't propagated to children after the fork. So this works well if: 1. Release of `spanS` happens on the same fiber as `spanS`. 2....

Not releasing in a state mismatch makes things mildly worse. Not only do we end on a different span, but we leak a span: Status quo: | | ambient |...

Oh, right. If we close it without resetting it, the only difference from the status quo is that `b`, not `root`, is ambient after `release a`. The end state is...

I would err on the side that has an open span as the ambient span, so fields have somewhere to go. But that's not a distinction here. And if there...