Once you've handed out the node you are not supposed to hand it out again until it has been deprovisioned. If you have no more nodes to provision then return empty list so that additional clouds have a chance to contribute.
Also good luck, there is no "correct" implementation of the Jenkins Cloud API. I argue that in its current form it is impossible to have a correct implementation. The following are, in order of correctness, the know "not too bad" cloud implementations: * operations-center-cloud (sorry closed source) * nectar-vmware (sorry closed source) * docker (yeah! open source... OTOH early versions of this were bad. I'm not sure if KS has merged his pull request making it "not too bad" yet, so check with KS as to whether to look at his PR or the master branch) * mansion-cloud (open source, but we are hitting the lower limit of "not too bad") Everything else has either race conditions that could well cause deadlock or improper behaviour (e.g. resource leaks, etc) and certainly should not be used as an example of what to do... generally the issues in these cloud plugins are subtle, but if you follow them too much you will be stuck in a design that is difficult to work your way to something "not too bad" HTH -Stephen On 6 September 2015 at 19:55, Stanislav Baiduzhyi <[email protected] > wrote: > Hi All, > > Quick question: writing cloud plugin, provisioning is called more than > once for the same label, but I have only one node to provision, should > I return the same instance once again, or should I return empty list > and Jenkins will reuse the node that was returned on first request? > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/CAFHiie5GcKQ9LU72K07y4OFcL3ZDSJQcWf7FiS2oEfRNwCnx3g%40mail.gmail.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMye36FC48LarE2ytN-hvr6w75RU3q4v31OjzyvuXMEAqg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
