java.lang.IllegalStateException: Promise already completed.

GitHub | fchaillou | 4 months ago
  1. 0

    There is some problem with changing result of flatMap to future: {code} val x = Observable(List("a")) val y = Observable(List("b")) val observable: Observable[String] = x.flatMap(x ⇒ y) observable.toFuture() {code} Code from above results in: {code} Promise already completed. java.lang.IllegalStateException: Promise already completed. at scala.concurrent.Promise$class.complete(Promise.scala:55) at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) at scala.concurrent.Promise$class.success(Promise.scala:86) at scala.concurrent.impl.Promise$DefaultPromise.success(Promise.scala:153) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anonfun$toFuture$1.apply(ObservableImplicits.scala:332) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anonfun$toFuture$1.apply(ObservableImplicits.scala:332) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anon$1.onNext(ObservableImplicits.scala:88) at org.mongodb.scala.internal.MapObservable$$anon$1.onNext(MapObservable.scala:32) at org.mongodb.scala.internal.FoldLeftObservable$$anon$1.onComplete(FoldLeftObservable.scala:35) at org.mongodb.scala.internal.FlatMapObservable$$anon$1.onComplete(FlatMapObservable.scala:71) at org.mongodb.scala.internal.IterableObservable$$anon$1.request(IterableObservable.scala:46) at org.mongodb.scala.internal.FlatMapObservable$$anon$1$$anon$2.request(FlatMapObservable.scala:54) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anon$1.onSubscribe(ObservableImplicits.scala:86) at org.mongodb.scala.internal.MapObservable$$anon$1.onSubscribe(MapObservable.scala:28) at org.mongodb.scala.internal.FoldLeftObservable$$anon$1.onSubscribe(FoldLeftObservable.scala:32) at org.mongodb.scala.internal.FlatMapObservable$$anon$1.onSubscribe(FlatMapObservable.scala:66) ... {code} I'm using mongo-scala-driver 1.1.0 and MongoDB server 3.2.3. In debug it looks like onNext is executed once again after onComplete.

    JIRA | 9 months ago | Michal B.
    java.lang.IllegalStateException: Promise already completed.
  2. 0

    There is some problem with changing result of flatMap to future: {code} val x = Observable(List("a")) val y = Observable(List("b")) val observable: Observable[String] = x.flatMap(x ⇒ y) observable.toFuture() {code} Code from above results in: {code} Promise already completed. java.lang.IllegalStateException: Promise already completed. at scala.concurrent.Promise$class.complete(Promise.scala:55) at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) at scala.concurrent.Promise$class.success(Promise.scala:86) at scala.concurrent.impl.Promise$DefaultPromise.success(Promise.scala:153) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anonfun$toFuture$1.apply(ObservableImplicits.scala:332) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anonfun$toFuture$1.apply(ObservableImplicits.scala:332) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anon$1.onNext(ObservableImplicits.scala:88) at org.mongodb.scala.internal.MapObservable$$anon$1.onNext(MapObservable.scala:32) at org.mongodb.scala.internal.FoldLeftObservable$$anon$1.onComplete(FoldLeftObservable.scala:35) at org.mongodb.scala.internal.FlatMapObservable$$anon$1.onComplete(FlatMapObservable.scala:71) at org.mongodb.scala.internal.IterableObservable$$anon$1.request(IterableObservable.scala:46) at org.mongodb.scala.internal.FlatMapObservable$$anon$1$$anon$2.request(FlatMapObservable.scala:54) at org.mongodb.scala.ObservableImplicits$ScalaObservable$$anon$1.onSubscribe(ObservableImplicits.scala:86) at org.mongodb.scala.internal.MapObservable$$anon$1.onSubscribe(MapObservable.scala:28) at org.mongodb.scala.internal.FoldLeftObservable$$anon$1.onSubscribe(FoldLeftObservable.scala:32) at org.mongodb.scala.internal.FlatMapObservable$$anon$1.onSubscribe(FlatMapObservable.scala:66) ... {code} I'm using mongo-scala-driver 1.1.0 and MongoDB server 3.2.3. In debug it looks like onNext is executed once again after onComplete.

    JIRA | 9 months ago | Michal B.
    java.lang.IllegalStateException: Promise already completed.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Observable.zip throws exception on complete

    GitHub | 7 months ago | alexandru
    java.lang.IllegalStateException: Promise already completed.
  5. 0

    NPE in ThrottlerTransportAdapter

    GitHub | 2 years ago | patriknw
    akka.actor.PostRestartException: exception post restart (class java.lang.NullPointerException)

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Promise already completed.

      at scala.concurrent.Promise$class.complete()
    2. Scala
      Promise$DefaultPromise.success
      1. scala.concurrent.Promise$class.complete(Promise.scala:55)[org.scala-lang.scala-library-2.11.7.jar:na]
      2. scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)[org.scala-lang.scala-library-2.11.7.jar:na]
      3. scala.concurrent.Promise$class.success(Promise.scala:86)[org.scala-lang.scala-library-2.11.7.jar:na]
      4. scala.concurrent.impl.Promise$DefaultPromise.success(Promise.scala:153)[org.scala-lang.scala-library-2.11.7.jar:na]
      4 frames
    3. com.omsignal.sync
      E4sOmplusElasticSearchIndexClient$$anonfun$1.apply$mcV$sp
      1. com.omsignal.sync.open.rest.omplus.E4sOmplusElasticSearchIndexClient$$anonfun$1.apply$mcV$sp(OmplusElasticSearchIndexClient.scala:93)[com.omsignal.sync-open-rest-1.25.6.jar:1.25.6]
      1 frame
    4. com.sksamuel.elastic4s
      BulkActor.postStop
      1. com.sksamuel.elastic4s.streams.BulkActor.postStop(BulkIndexingSubscriber.scala:176)[com.sksamuel.elastic4s.elastic4s-streams_2.11-2.3.0.omsignal.jar:2.3.0.omsignal]
      1 frame
    5. Akka Actor
      Actor$class.aroundPostStop
      1. akka.actor.Actor$class.aroundPostStop(Actor.scala:492)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      1 frame
    6. com.sksamuel.elastic4s
      BulkActor.aroundPostStop
      1. com.sksamuel.elastic4s.streams.BulkActor.aroundPostStop(BulkIndexingSubscriber.scala:86)[com.sksamuel.elastic4s.elastic4s-streams_2.11-2.3.0.omsignal.jar:2.3.0.omsignal]
      1 frame
    7. Akka Actor
      Mailbox.exec
      1. akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:210)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      2. akka.actor.dungeon.FaultHandling$class.terminate(FaultHandling.scala:172)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      3. akka.actor.ActorCell.terminate(ActorCell.scala:374)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      4. akka.actor.ActorCell.invokeAll$1(ActorCell.scala:467)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      5. akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      6. akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      7. akka.dispatch.Mailbox.processMailbox(Mailbox.scala:260)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      8. akka.dispatch.Mailbox.run(Mailbox.scala:224)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      9. akka.dispatch.Mailbox.exec(Mailbox.scala:234)[com.typesafe.akka.akka-actor_2.11-2.4.6.jar:na]
      9 frames
    8. Scala
      ForkJoinWorkerThread.run
      1. scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)[org.scala-lang.scala-library-2.11.7.jar:na]
      2. scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)[org.scala-lang.scala-library-2.11.7.jar:na]
      3. scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)[org.scala-lang.scala-library-2.11.7.jar:na]
      4. scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)[org.scala-lang.scala-library-2.11.7.jar:na]
      4 frames