-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
Summary:
Split Cloud.canProvision(Label) API into two operations:
- couldProvision(Label) - the Cloud supports this label.
- canProvision(Label) - this Cloud supports this label and can provision it now.
& clarify docs.
Background:
The [Javadoc|https://javadoc.jenkins.io/hudson/slaves/Cloud.html] for Cloud.canProvision(Label) says:
"Returns true if this cloud is capable of provisioning new nodes for the given label."
But this can be interpreted in different ways:
- I can handle those labels.
- I handle those labels and can provision something (I am not over subscribed).
The problem with the first interpretation is that when this Cloud is oversubscribed it continues to return true preventing other Clouds from being asked to provision, so suggest clarifying that Javadoc to make clear that canProvision() has the second meaning.
Then, we add another method with the first meaning, e.g. _could_Provision(Label). This is to support the case where a Cloud handles the label, but can't provision right now (since Clouds are cached in Labels.clouds and won't get refreshed until Jenkins.trimLabels() next runs).
- relates to
-
JENKINS-67099 trimLabels calling Cloud#canProvision too often
- Closed