Open haja opened 3 months ago
Yeah, that's definitely not intended. You're right that the cause is inside ZStream.fromInputStream
. We'll likely have to essentially take that implementation and then change the ZIO.attemptBlockingIO
to ZIO.attemptBlockingCancelable
in order to support proper interruption for the stream combinators.
I'll see if I can fix this over the weekend and cut a new release. There's been a bunch of changes for Scala.js and Scala Native support since I last did anything significant on this project so it looks like I have to clean up some stuff before I can do a full release.
@reibitto I think this constructor should be fixed or provided by zio-streams instead of reimplement a variant of ZStream.fromInputStream
in zio-process. I've created an issue for zio-streams zio/zio#9084
But feel free to implement a workaround if you can fix it before a new version of zio-streams gets released
Sorry, Scala.js and Scala Native were giving me problems but I created the PR and should merge and release soon: #430
I agree it would be nice to get https://github.com/zio/zio/issues/9084 in, but I fixed the issue locally in the meantime. Actually I cancel the process explicitly because attemptBlockingCancelable
has less overhead than attemptBlockingInterrupt
.
Hey, if I run this the program hangs for the full 3 seconds of
sleep 3
, instead of failing after 1 second by thetimeoutFail(..)
.sample output:
The issue seems to be that
zio.process.ProcessStream.stream
(called bylinesStream
) usesZStream.fromInputStreamZIO
, which in turn opens the InputStream withZIO.attemptBlockingIO
, which is not interruptible.