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
[FIXED JENKINS-28446] - proper calculation of queue length in UnlabeledLoadStatistics #1709
[FIXED JENKINS-28446] - proper calculation of queue length in UnlabeledLoadStatistics #1709
Conversation
Just to prevent similar misuses in the future.
This implementation does not create new methods in API, hence it can be backported.
You've implemented the old API not the new one |
So what you really need to do is fix |
The old API is still being by external callers. The "modern" API will be use filters (which are correct) or be defaulted to the call I've fixed
This change is definitely useful as an extra patch, but it does not replace the fix for the Old API, which should be back-portable to 1.609 |
You should not be iterating the Queue from the load stats You should be using the snapshot in Queue. af55e53 was the commit that broke countBuildableItemsFor in this regard |
By doing the iteration in ULS you force the allocation of a new array list. Much better to just have a correct method in Queue and call that. Some investigation is required to determine why af55e53 needed to count tasks with no assigned label as being valid for a specific label |
I suppose the committer just wanted to use this method in
I'll introduce such API method. BTW, the current implementation should be backported to the previous LTS, hence I propose to add a separate commit w/o squashing it |
Well if you want to backport a fix it should be a different fix for pre 1.607 Don't mess up the tuned code in 1.607+ just because you want to backport the fix to pre 1.607. Create a pull request against the specific branch and fix master the right way |
It will be back-ported to 1.609.x, so there's no need in the completely different fix |
Then fix it right. Don't count in the ULS count in Queue and just invoke the method direct to save spinning out an Array List |
…erformance of UnlabeledLoadStatistics
@stephenc |
👍 but I would prefer if we could find out why countBuildabelItemsFor needs the special counting of items with a null label |
@stephenc Any hack becomes a "feature" after 2 years, so I would not revert the existing behavior |
Well it would be good to document why in the code |
👍 in so much as I get the problem |
👍 |
[FIXED JENKINS-28446] - proper calculation of queue length in UnlabeledLoadStatistics
https://issues.jenkins-ci.org/browse/JENKINS-28446
UnlabeledLoadStatistics:: computeQueueLength()
was broken starting from the first release (reason - wrong assumption due to the undocumented behavior ofQueue::countBuildableItemsFor()
). There's n impact on cloud provisioners if a job has no label definitions.The fix enforces a filtering of queue items with labels. Backporting to the current LTS is required IMO.
@reviewbybees @recampbell