-
-
Notifications
You must be signed in to change notification settings - Fork 629
raiseError causes writeOutputStream to hang #2931
Copy link
Copy link
Closed
Labels
Description
H/t to @bpholt for the original minimization in https://github.com/Dwolla/fs2-hang-repro
//> using scala "3.1.3"
//> using lib "co.fs2::fs2-io::3.2.8"
package repro
import cats.effect._
import cats.syntax.all._
import fs2._
import fs2.io.{readOutputStream, writeOutputStream}
object Bug extends IOApp.Simple {
override def run: IO[Unit] = {
val s = Stream
.emit[IO, Byte](0)
.repeat
.take(3)
.through { in =>
readOutputStream(1) { out =>
in
.through(writeOutputStream(IO.pure(out)))
.compile
.drain
}
}
// remove the raiseError and it completes normally
(s *> Stream.raiseError[IO](new RuntimeException("boom"))).compile.drain
}
}Reactions are currently unavailable