-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Total running Jobs must not exceed maxScale - Running jobs #528
Conversation
LGTM, thanks @balchua ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this with a Kafka scaler and seems to work fine!
One thing I've noticed is that the scaler will create a job per message even if there are jobs running already. This isn't something this PR introduced but it is something this PR can help fix.
It might be worth adding to the code, to only create the necessary number of jobs as there are messages in the queue, otherwise you might end up with 5 jobs for 1 message.
@Cottonglow by setting |
I realized that you are using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @balchua!
@balchua I've experimented by putting the value of If the idea is to have 1 job per message (which is what I understand the plan is from the docs), then this wouldn't work. Unless this is a problem with the Kafka scaler only. This can be a consideration for a future PR though if it is too much work as this does fix the problem of the number of jobs exceeding the max value which is very useful now. |
@Cottonglow i was using rabbitmq scaler. The code in keda/pkg/handler/scale_loop.go Lines 82 to 85 in 8658859
Only considers metricName of queuelength . So i was just wondering how it worked for kafka scaler.
|
Forget about my previous comment 😁. I got it figured out. |
Well it is still going to start |
@ahmelsayed is this one ready to merge? |
@jeffhollan, i have yet to work on the review given above. 😁 |
@stgricci i have updated the code to make sure |
@ahmelsayed i think this is good to go. @stgricci gave his thumbs up. 😁 |
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
This PR is to honor the
queueLength
taking into account the number of running Jobs.In short, total running Jobs will be
queueLength - runningJobs
.Running jobs are those jobs which are not in
Completed
orFailed
Status.This should address issue #525