Avoid / by zero in SmallestMailboxRouter also, see #2442
This commit is contained in:
parent
ccfd8454fc
commit
d9bd43a1fa
1 changed files with 3 additions and 1 deletions
|
|
@ -859,7 +859,9 @@ trait SmallestMailboxLike { this: RouterConfig ⇒
|
|||
currentScore: Long = Long.MaxValue,
|
||||
at: Int = 0,
|
||||
deep: Boolean = false): ActorRef =
|
||||
if (at >= targets.size) {
|
||||
if (targets.isEmpty)
|
||||
routeeProvider.context.system.deadLetters
|
||||
else if (at >= targets.size) {
|
||||
if (deep) {
|
||||
if (proposedTarget.isTerminated) targets(ThreadLocalRandom.current.nextInt(targets.size)) else proposedTarget
|
||||
} else getNext(targets, proposedTarget, currentScore, 0, deep = true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue