-
Bug
-
Resolution: Fixed
-
Critical
-
None
Given the following declarative pipeline:
pipeline { stages { stage('Example stage') { when { expression { false } } options { lock resource: 'example resource' } steps { // ... } } } }
Even though 'example stage' is skipped due to the when conditional, a lockable resource 'example resource' is created (if it doesn't already exist) and a lock is acquired on it. I think this is counter intuitive. The consequence is also really bad – a skipped stage might actually make the whole build hang (possibly for a long time) because it needs to acquire a lock on a busy resource (typically used by another build).
- causes
-
JENKINS-61007 pipeline-model-definition is using findbugs without providing / depending on it
- Resolved
- is duplicated by
-
JENKINS-55485 Declarative pipeline, lock() in stage options is executed before when clause
- Closed
- links to