java.lang.IllegalStateException: Promise already completed.**

GitHub | langtu329 | 2 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.

    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)[marathon:1.1.2]
      2. scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153)[marathon:1.1.2]
      3. scala.concurrent.Promise$class.success(Promise.scala:86)[marathon:1.1.2]
      4. scala.concurrent.impl.Promise$DefaultPromise.success(Promise.scala:153)[marathon:1.1.2]
      4 frames
    3. mesosphere.marathon.upgrade
      StoppingBehavior$$anonfun$receive$1.applyOrElse
      1. mesosphere.marathon.upgrade.StoppingBehavior$class.checkFinished(StoppingBehavior.scala:85)[marathon:1.1.2]
      2. mesosphere.marathon.upgrade.TaskKillActor.checkFinished(TaskKillActor.scala:13)[marathon:1.1.2]
      3. mesosphere.marathon.upgrade.StoppingBehavior$class.synchronizeTasks(StoppingBehavior.scala:79)[marathon:1.1.2]
      4. mesosphere.marathon.upgrade.TaskKillActor.synchronizeTasks(TaskKillActor.scala:13)[marathon:1.1.2]
      5. mesosphere.marathon.upgrade.StoppingBehavior$$anonfun$receive$1.applyOrElse(StoppingBehavior.scala:60)[marathon:1.1.2]
      5 frames
    4. Akka Actor
      Actor$class.aroundReceive
      1. akka.actor.Actor$class.aroundReceive(Actor.scala:465)[marathon:1.1.2]
      1 frame
    5. mesosphere.marathon.upgrade
      TaskKillActor.aroundReceive
      1. mesosphere.marathon.upgrade.TaskKillActor.aroundReceive(TaskKillActor.scala:13)[marathon:1.1.2]
      1 frame
    6. Akka Actor
      Mailbox.exec
      1. akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)[marathon:1.1.2]
      2. akka.actor.ActorCell.invoke(ActorCell.scala:487)[marathon:1.1.2]
      3. akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)[marathon:1.1.2]
      4. akka.dispatch.Mailbox.run(Mailbox.scala:221)[marathon:1.1.2]
      5. akka.dispatch.Mailbox.exec(Mailbox.scala:231)[marathon:1.1.2]
      5 frames
    7. Scala
      ForkJoinWorkerThread.run
      1. scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)[marathon:1.1.2]
      2. scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)[marathon:1.1.2]
      3. scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)[marathon:1.1.2]
      4. scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)[marathon:1.1.2]
      5. scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)[marathon:1.1.2]
      5 frames