jenkinsci / jenkinsci/workflow-durable-task-step-plugin
[JENKINS-49644] API does not return all running builds
- Dominant language
- Java
- Stars
- 46
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
Fetching node information from a node running a pipeline build returns very little information about the executor.
Hitting this URL - https://JENKINS_URL/computer//api/json?depth=2 - returns this about the executors:
```
...
"executors": [{
"currentExecutable": null,
"idle": false,
"likelyStuck": false,
"number": 0,
"progress": 5
}, {
"currentExecutable": {
"_class": "hudson.model.FreeStyleBuild",
"actions": [{
"_class": "hudson.model.CauseAction",
"causes": [{
"_class": "hudson.triggers.TimerTrigger$TimerTriggerCause",
"shortDescription": "Started by timer"
}]
}, {
"_class": "jenkins.metrics.impl.TimeInQueueAction"
},
...
```
The problem with this comes when we use the Python SDK because that uses the currentExecutable key to gather information about running builds:
https://github.com/openstack/python-jenkins/blob/16007e01858cc5d36afdc31d22b5644f91a1f935/jenkins/__init__.py#L1149
We discovered this because the automation we use to scale our build cluster up and down doesn't see any jobs running on nodes which are running pipeline builds and so they get terminated mid-build.
This did work with previous versions of Jenkins/Pipeline but I can't find any mention of a regression anywhere.
---
Originally reported by grahamlyons, imported from: API does not return all running builds
Raw content of original issue
Fetching node information from a node running a pipeline build returns very little information about the executor.
Hitting this URL - https://JENKINS_URL/computer/<NODE_NAME>/api/json?depth=2 - returns this about the executors:
...
"executors": [{
"currentExecutable": null,
"idle": false,
"likelyStuck": false,
"number": 0,
"progress": 5
}, {
"currentExecutable": {
"_class": "hudson.model.FreeStyleBuild",
"actions": [{
"_class": "hudson.model.CauseAction",
"causes": [{
"_class": "hudson.triggers.TimerTrigger$TimerTriggerCause",
"shortDescription": "Started by timer"
}]
}, {
"_class": "jenkins.metrics.impl.TimeInQueueAction"
},
...The problem with this comes when we use the Python SDK because that uses the currentExecutable key to gather information about running builds:
https://github.com/openstack/python-jenkins/blob/16007e01858cc5d36afdc31d22b5644f91a1f935/jenkins/__init__.py#L1149We discovered this because the automation we use to scale our build cluster up and down doesn't see any jobs running on nodes which are running pipeline builds and so they get terminated mid-build.
This did work with previous versions of Jenkins/Pipeline but I can't find any mention of a regression anywhere.
- environment:
Jenkins 2.89.3, Pipeline 2.5
Contributor guide
Assessment
This issue has not been assessed yet.