-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 1.642.2
digitalocean-plugin 0.10
to reproduce (exact numbers are not important):
create DigitalOcean cloud in Jenkins with 10 droplets limit.
create 10 different images under that cloud
set limit for every droplet == total droplets limit
start a lot of build jobs to utilize all the images in the same time (say 10 jobs per image)
result:
jenkins perform queries to DigitalOcean API all the time to list droplets, create new droplet and so on. it leads to "API rate limit exceeded" error and inability to delete idle slaves automatically.
capacity per image is set == total cloud capacity because we want to be able to use the whole cloud capacity with every image created.
possible reason: digitalocean-plugin wrongly checks the # of running slaves and perhaps has a bug in logic.
[JENKINS-35022] digitalOcean plugin logic leads to endless API requests, API rate limit exceeded
Description |
Original:
to reproduce (exact numbers are not important): create DigitalOcean cloud in Jenkins with 10 droplets limit. create 10 different images under that cloud set limit for every droplet == total droplets limit start a lot of build jobs to utilize all the images in the same time (say 10 jobs per image) result: jenkins perform queries to DigitalOcean API all the time to list droplets, create new droplet and so on. it leads to "API rate limit exceeded" error and inability to delete idle slaves automatically. capacity per image is set == total cloud capacity because we want to be able to use the whole cloud capacity with every image created. possible reason: digitalocean-plugin wrongly checks running slaves and perhaps has a bug in logic. possible fix: {noformat} diff --git a/src/main/java/com/dubture/jenkins/digitalocean/Cloud.java b/src/main/java/com/dubture/jenkins/digitalocean/Cloud.java index 9956c91..13ac3f4 100644 --- a/src/main/java/com/dubture/jenkins/digitalocean/Cloud.java +++ b/src/main/java/com/dubture/jenkins/digitalocean/Cloud.java @@ -168,8 +168,8 @@ public class Cloud extends hudson.slaves.Cloud { count ++; } } - - if (count >= Math.min(instanceCap, slaveTotalInstanceCap)) { + // we can provision new cloud instance only if (count < instanceCap) AND (count < slaveTotalInstanceCap) + if ((count < instanceCap) && (count < slaveTotalInstanceCap)) { return true; } @@ -184,7 +184,7 @@ public class Cloud extends hudson.slaves.Cloud { } } - return count >= Math.min(instanceCap, slaveTotalInstanceCap); + return ((count < instanceCap) && (count < slaveTotalInstanceCap)); } /** {noformat} |
New:
to reproduce (exact numbers are not important): create DigitalOcean cloud in Jenkins with 10 droplets limit. create 10 different images under that cloud set limit for every droplet == total droplets limit start a lot of build jobs to utilize all the images in the same time (say 10 jobs per image) result: jenkins perform queries to DigitalOcean API all the time to list droplets, create new droplet and so on. it leads to "API rate limit exceeded" error and inability to delete idle slaves automatically. capacity per image is set == total cloud capacity because we want to be able to use the whole cloud capacity with every image created. possible reason: digitalocean-plugin wrongly checks the # of running slaves and perhaps has a bug in logic. |
Workflow | Original: JNJira [ 171231 ] | New: JNJira + In-Review [ 184236 ] |