jenkinsci / jenkinsci/lockable-resources-plugin

Locking pipeline without using executors

Open
#732 2 comments 0 reactions 0 assignees View on GitHub
Triage
Dominant language
Java
Stars
99
Forks
205
Avg merge
2d 13h
Merged PRs (30d)
8

Description

### What feature do you want to see added?

I run Jenkins in a kubernetes environment. I am trying to lock an entire pipeline so it runs as a single unit. I need this because I have multiple levels of priority of jobs, and need to be able to block execution of jobs in more than the single way allowed by the build-blocker plugin.

When running a simple pipeline like this:

```
pipeline {
agent any
options{
lock(resource: "shared_resource_lock",quantity:1,priority:0)
}
stages {
stage("test") {
steps {
sh("sleep 300")
}
}
}
}
```

If I have ten executors and build ten of these simultaneously, all ten executors will be busy, with 9 of them waiting on locks and blocking other buildable jobs. I would like the lock interpreted before being assigned an executor so that it's waiting in the queue and not blocking other buildable jobs.

### Upstream changes

_No response_

### Are you interested in contributing this feature?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.