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 throws exception on complete #144

alexandru opened this Issue Apr 27, 2016 · 1 comment


None yet
1 participant
Copy link

alexandru commented Apr 27, 2016

Signaled by @cranst0n on April 26, 2016 8:15 PM:

import monix.reactive.Observable

val obs0 = Observable.fromIterable(Array(Array(1, 2), Array(2, 3)))
val obs1 = Observable.fromIterable(Array(Array(4, 5), Array(5, 6)))
val obs2 = Observable.fromIterable(Array(Array(7, 8), Array(8, 9)))

val obsVec = Vector(obs0, obs1, obs2)
val zipped = Observable.zipList(obsVec: _*).map(_.flatten)

zipped.foreach(x => println(x.mkString(",")))

This sample triggers an error:

Ian McIntosh @cranst0n Apr 26 18:35
This is my first attempt:
observables.foldLeft(Observable.repeat(Array.empty[Int]))(_.zipWith(_)(_ ++ _))
but it blows up with:
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)

This was a stupid mistake brought to life because of a race condition.

alexandru added a commit that referenced this issue Apr 27, 2016


This comment has been minimized.

Copy link
Member Author

alexandru commented May 2, 2016

Fixed in 2.0-RC2.

@alexandru alexandru closed this May 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.