apache / apache/openwhisk

A question about conditional statement in loadBalancer

Open
#4,892 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Scala
Stars
6.8k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

Hello,
I'd like to ask this small question I found while looking at the loadbalancer code below.

https://github.com/apache/openwhisk/blob/master/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/ShardingContainerPoolBalancer.scala#L417

According to my understanding and comment, it seems to be a conditional statement to know whether it have gone through all the invokers or not. However, stepsDone starts counting from zero, and the numInvokers initializes with invokers.size. I think the condition should be
stepsDone + 1 == numInvokers .
Could you explain what is the meaning of that condition?
Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.