apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.56k stars 1.17k forks source link

Openwhisk FPCPoolbalancer scheduler pick based on queueSize #5377

Closed blossomin closed 1 year ago

blossomin commented 1 year ago

Environment details:

Steps to reproduce the issue:

  1. https://github.com/apache/openwhisk/blob/master/core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/FPCPoolBalancer.scala#L741 this line is used to choose a scheduler by the FPCPoolBalancer. And it uses the queueSize as a base to get a scheduler with the least queueSize. But I searched the whole project, the queueSize is not updated after this scheduler creates a new queue. Is this a bug? or we should use the API getQueueSize (for schedulercore) to replace the code here?

Additional information you deem important:

bdoyle0182 commented 1 year ago

Hi @blossomin no this is not a bug. The queueSize is updated whenever the schedulerEndpoints trieMap is reloaded from etcd. The schedulers are responsible for updating how many queues are running them to the db, then the controllers will periodically reload this data. See L563 of the FPCPoolBalancer, the function called loadSchedulerEndpoint().