Delay while agent launching

38 views
Skip to first unread message

Alex Earl

unread,
May 10, 2023, 1:20:47 PM5/10/23
to Jenkins Developer List
I developed a plugin to launch agents on our internal "cloud" infrastructure. These agents are launched via an SSH command which launches the agent process and has the JNLPLauncher as the actual launcher. What I see happen is that multiple agents are trying to spin up even though there is only one job (these are single shot type agents). I believe this is happening because there is some delay to when the SSH command is executed and when the agent is connecting to the controller. Is there a way to throttle the bring-up of additional agents for a period of time for that specific job requirement? I would like to delay say 30 seconds or more before another agent is launched for that same job.

Thanks!

Alex

James Nord

unread,
May 10, 2023, 6:15:01 PM5/10/23
to jenkin...@googlegroups.com
You need to keep track of what provisioning requests you have in flight (that have not failed) and then act accordingly when called by looking at the CloudState https://javadoc.jenkins.io/hudson/slaves/Cloud.html#provision(hudson.slaves.Cloud.CloudState,int)

By single shot I am taking it you mean ephemeral (created for a single freestyle job or node block, then destroyed, not https://plugins.jenkins.io/one-shot-executor/ which doesn't work so well.


--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcFGEfb%3DpCOOwFYkSP%2BoDuuZmct-Xn3x9P9GOV80xSkAA%40mail.gmail.com.

Alex Earl

unread,
May 10, 2023, 7:47:19 PM5/10/23
to jenkin...@googlegroups.com
Ok, that makes sense. I had something in the code for something like that, but had it disabled because I didn't think it would work for what I wanted, but I think I just need to tweak a couple of things. Thanks for the help! I did mean ephemeral, I just couldn't remember that term.

Regards,

Alex



--
Reply all
Reply to author
Forward
0 new messages