You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ERROR] [12/15/201514:16:21.061] [model-market-dispatcher-6] [akka://model/user/$b/clearing-mechanism] next on empty iterator
java.util.NoSuchElementException: next on empty iterator
at scala.collection.immutable.RedBlackTree$TreeIterator.next(RedBlackTree.scala:475)
at scala.collection.IterableLike$class.head(IterableLike.scala:107)
at scala.collection.mutable.TreeSet.head(TreeSet.scala:41)
at scala.collection.TraversableLike$class.headOption(TraversableLike.scala:440)
at scala.collection.mutable.TreeSet.headOption(TreeSet.scala:41)
at markets.clearing.engines.CDAMatchingEngine.accumulateBidOrders(CDAMatchingEngine.scala:108)
at markets.clearing.engines.CDAMatchingEngine.findMatch(CDAMatchingEngine.scala:66)
at markets.clearing.ClearingMechanismLike$$anonfun$clearingMechanismBehavior$1.applyOrElse(ClearingMechanismLike.scala:39)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at akka.actor.Actor$class.aroundReceive(Actor.scala:480)
at markets.clearing.ClearingMechanismActor.aroundReceive(ClearingMechanismActor.scala:39)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Here is the application.conf file used to generate the bug. Bug appeared as soon as I started allowing market orders. This suggests that bug occurs when either askOrderBook or bidOrderBook is empty?
Possibly a bug with TreeSet? Seems unlikely...
The text was updated successfully, but these errors were encountered:
I have found the source of this issue: my stupidity. I was creating a single (mutable!) MatchingEngine object and passing it around to a bunch of market actors creating that were mutating it concurrently! Bad...
Here is an example of the stack trace...
Here is the application.conf file used to generate the bug. Bug appeared as soon as I started allowing market orders. This suggests that bug occurs when either
askOrderBook
orbidOrderBook
is empty?Possibly a bug with
TreeSet
? Seems unlikely...The text was updated successfully, but these errors were encountered: