-
Bug
-
Resolution: Unresolved
-
Minor
-
None
Build Executor Status reports negative count...
built-in node (-2 of 0 executors busy)
Jenkins 2.368
Duplicate the issue
I can duplicate the problem briefly with the following steps (rather complicated, but fails consistently)
- Install Jenkins 2.361.1 with the ssh agents plugin
- Configure 2 inbound agents, inbound-agent-1 and inbound-agent-2 using websockets
- Connect the inbound agents
- Define two jobs named job-for-inbound-agent-1 and job-inbound-agent-2 and restrict their execution to agents similar to the job name
- Run the two jobs and confirm that they execute on the inbound agents
- Add an ssh credential that can be used to start an ssh agent
- Configure an ssh agent using that ssh credential and confirm that it starts as expected
- Make a change on the file system of the ssh agent that will prevent the agent from starting. In my case, the agent working directory was /tmp/ssh-agent-1 and I made that directory owned by the root user with permission 700
- Kill the agent process on the ssh agent and confirm that the controller shows that the agent is not connected
- Critical step: Collapse the "Build executor status" entry on the left side of the agent configuration page (without this step, the negative executor count won't be seen). In my case the agent configuration page is http://testing-a.markwaite.net:8080/computer/ssh-agent-1/
- Press the "Relaunch Agent" button on the agent configuration page and watch the executor count while the controller attempts to launch the agent. The counter will briefly report built-in node (-1 of 2 executors busy). Note that the display of the negative executor count is brief in this case. On my larger scale controller (20+ssh agents with many of them disconnected at any specific time), I see the negative executor count frequently and it persists
I am not able to show a negative executor count when only using inbound agents. The count increments and decrements as expected when I stop and restart inbound agents.
I am not able to show a negative executor count when ssh agents are all connected.
Considering how obscure this case is, I'm not worried about anyone spending the effort to investigate it. What I've seen is a minor visual annoyance that does not affect users in any significant way.
As far as I recall, this behavior has existed for at least 9 months, possibly much longer than that.
Starter script to duplicate the issue
#!/bin/bash # User reports negative exceutors in summary JENKINS_WAR_VERSION=2.361.1 JENKINS_WAR=jenkins-${JENKINS_WAR_VERSION}.war PLUGIN_MANAGER_VERSION=2.12.9 PLUGIN_MANAGER_JAR=jenkins-plugin-manager-${PLUGIN_MANAGER_VERSION}.jar if [ ! -f ../$PLUGIN_MANAGER_JAR ]; then wget https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_MANAGER_VERSION}/$PLUGIN_MANAGER_JAR mv $PLUGIN_MANAGER_JAR .. fi if [ ! -d plugins ]; then mkdir plugins fi java -jar ../$PLUGIN_MANAGER_JAR --jenkins-version $JENKINS_WAR_VERSION --latest false --plugin-download-directory plugins --plugin-file plugins.txt if [ ! -f ../$JENKINS_WAR ]; then wget https://get.jenkins.io/war-stable/${JENKINS_WAR_VERSION}/jenkins.war mv jenkins.war ../$JENKINS_WAR fi JENKINS_HOME=. java -jar ../$JENKINS_WAR
Plugins.txt file for plugins used in the test
bouncycastle-api:2.26 credentials:1189.vf61b_a_5e2f62e instance-identity:116.vf8f487400980 javax-activation-api:1.2.0-4 javax-mail-api:1.6.2-7 ssh-credentials:305.v8f4381501156 ssh-slaves:2.846.v1b_70190624f5 structs:324.va_f5d6774f3a_d trilead-api:2.72.v2a_3236754f73