rabbah commented on a change in pull request #3451: Fix several loadbalancer
bugs.
URL:
https://github.com/apache/incubator-openwhisk/pull/3451#discussion_r175640847
##########
File path:
core/controller/src/main/scala/whisk/core/loadBalancer/ShardingContainerPoolBalancer.scala
##########
@@ -331,9 +338,10 @@ object ShardingContainerPoolBalancer extends
LoadBalancerProvider {
val healthyInvokers = invokers.filter(_.status == Healthy)
if (healthyInvokers.nonEmpty) {
// Choose a healthy invoker randomly
- val random =
ThreadLocalRandom.current().nextInt(healthyInvokers.size)
- dispatched(random).forceAcquire()
- Some(healthyInvokers(random).id)
+ val random =
healthyInvokers(ThreadLocalRandom.current().nextInt(healthyInvokers.size)).id
+ dispatched(random.toInt).forceAcquire()
+ logging.warn(this, s"system is overloaded. Chosen
invoker${random.toInt} by random.")
Review comment:
Chosen invoker${random.toInt} by random. -> Chose invoker${random.toInt} by
random assignment.
(or just randomly).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services