Closed xkrillex closed 10 months ago
Hello, we are encountering the same problem, in a different context : we have multiple ZIO that we run in parallel, to make it simple, let's say we have the following ZIO :
kafkaConsumerOnCluster1 <&> apiServerWithKafkaProducer <&> kafkaConsumerOnCluster2
if any ZIO fails, the program hangs with a similar stacktrace as mentioned in this issue :
Exception in thread "main" Exception in thread "zio-fiber-1" java.util.concurrent.RejectedExecutionException: Unable to run zio.internal.FiberRuntime@5eab1cd1
at zio.Executor.submitOrThrow(Executor.scala:79)
Caused by: java.util.concurrent.RejectedExecutionException: Unable to run zio.internal.FiberRuntime@5eab1cd1
at zio.Executor.submitOrThrow(Executor.scala:79)
at zio.internal.FiberRuntime.drainQueueLaterOnExecutor(FiberRuntime.scala:249)
at zio.internal.FiberRuntime.tell(FiberRuntime.scala:1404)
at zio.internal.FiberRuntime.$anonfun$interruptAsFork$1(FiberRuntime.scala:130)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:904)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1174)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:890)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:890)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:890)
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:890)
at zio.internal.FiberRuntime.evaluateEffect(FiberRuntime.scala:381)
at zio.internal.FiberRuntime.evaluateMessageWhileSuspended(FiberRuntime.scala:504)
at zio.internal.FiberRuntime.drainQueueOnCurrentThread(FiberRuntime.scala:220)
at zio.internal.FiberRuntime.run(FiberRuntime.scala:139)
at zio.internal.ZScheduler$$anon$4.run(ZScheduler.scala:478)
The problem is that, as the process does not complete, the pod remains up and we have no way to restart or stop the kafka consumer ZIO. We tried to remove the kafka consumer ZIO, and the problem disappears, so it is the responsible.
We encountered this with zio-kafka 2.3.4
and 2.6.0
and zio 2.0.18
.
This bug should be solved with zio-kafka 2.7.0 with #1109. Please re-open this issue when you still see the problem.
zio-kafka 2.4.1 zio 2.0.13
Here is a small reproducer:
With following error during shutdown: