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

onNext is not allowed when the stream has not requested elements #11

Closed
martinstuder opened this issue Jun 11, 2015 · 3 comments
Closed

Comments

@martinstuder
Copy link

We're getting the following occassional exception in our logs:

java.lang.IllegalStateException: onNext is not allowed when the stream has not requested elements, totalDemand was 0
        at akka.stream.actor.ActorPublisher$class.onNext(ActorPublisher.scala:190) ~[com.typesafe.akka.akka-stream-experimental_2.11-1.0-RC3.jar:na]
        at com.softwaremill.react.kafka.KafkaActorPublisher.onNext(KafkaActorPublisher.scala:12) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at com.softwaremill.react.kafka.KafkaActorPublisher$$anonfun$com$softwaremill$react$kafka$KafkaActorPublisher$$readDemandedItems$1.apply(KafkaActorPublisher.scala:35) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at com.softwaremill.react.kafka.KafkaActorPublisher$$anonfun$com$softwaremill$react$kafka$KafkaActorPublisher$$readDemandedItems$1.apply(KafkaActorPublisher.scala:35) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at scala.Option.foreach(Option.scala:257) ~[org.scala-lang.scala-library-2.11.6.jar:na]
        at com.softwaremill.react.kafka.KafkaActorPublisher.com$softwaremill$react$kafka$KafkaActorPublisher$$readDemandedItems(KafkaActorPublisher.scala:35) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at com.softwaremill.react.kafka.KafkaActorPublisher$$anonfun$receive$1.applyOrElse(KafkaActorPublisher.scala:17) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at akka.actor.Actor$class.aroundReceive(Actor.scala:467) ~[com.typesafe.akka.akka-actor_2.11-2.3.11.jar:na]
        at com.softwaremill.react.kafka.KafkaActorPublisher.akka$stream$actor$ActorPublisher$$super$aroundReceive(KafkaActorPublisher.scala:12) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at akka.stream.actor.ActorPublisher$class.aroundReceive(ActorPublisher.scala:317) ~[com.typesafe.akka.akka-stream-experimental_2.11-1.0-RC3.jar:na]
        at com.softwaremill.react.kafka.KafkaActorPublisher.aroundReceive(KafkaActorPublisher.scala:12) ~[com.softwaremill.reactive-kafka_2.11-0.6.0.jar:0.6.0]
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) ~[com.typesafe.akka.akka-actor_2.11-2.3.11.jar:na]
        at akka.actor.ActorCell.invoke(ActorCell.scala:487) ~[com.typesafe.akka.akka-actor_2.11-2.3.11.jar:na]
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) ~[com.typesafe.akka.akka-actor_2.11-2.3.11.jar:na]
        at akka.dispatch.Mailbox.run(Mailbox.scala:220) ~[com.typesafe.akka.akka-actor_2.11-2.3.11.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_40]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_40]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_40]

It doesn't seem like the stream is suffering from this, probably due to the one-for-one actor recover strategy.

dbuschman7 pushed a commit to dbuschman7/reactive-kafka that referenced this issue Jun 14, 2015
@dbuschman7
Copy link

I have added a PR #13 for this issue. We ran into as well.

kciesielski added a commit that referenced this issue Jun 16, 2015
Fix for issue #11 onNext IllegalStateException
@iamthiago
Copy link

I've been running on this =) Thanks @dbuschman7 for the PR. Waiting for that.

@gvd
Copy link

gvd commented Jul 20, 2015

This fix is not present in version 0.6.0 I believe. When will this fix be available in the maven repo?

@ennru ennru added this to the invalid milestone Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants