-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
1.651.3.1, Pipeline 2.4
Steps to reproduce:
1. Create a new pipeline job with code similar to
```
#!groovy
def myVar
node {
myVar = getMyVar()
echo "myVar is ${myVar}"
echo "Loaded pipeline script."
}
def getMyVar() {
myVar ? myVar : my_var
}
```
2. Observe CPU spike, and that job cannot be terminated
See overflow.txt for exception in CPS.
[JENKINS-40133] Referencing non-existant variable in Pipeline causes CPU to spike and job to hang
Component/s | New: pipeline [ 21692 ] | |
Component/s | Original: core [ 15593 ] |
Component/s | New: workflow-cps-plugin [ 21713 ] | |
Component/s | Original: pipeline [ 21692 ] |
The problem is the var is the same name as the getter and you're entering an infinite loop.
I've seen this once or twice before and think this is a Groovy CPS specific issue. jglick Do we have an issue for this?