timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-42248] Need an extension point to provide read/write locks on item storage locations #3889

Open timja opened 7 years ago

timja commented 7 years ago

Currently, renaming or moving an item in Jenkins is non-trivial:

  1. You need to ensure that the item is not currently building
  2. If the item is a folder, you need to ensure that none of the child items are currently building.
  3. If the item (or any child item) is in the queue, you need to ensure that the queue item is blocked from execution (currently this can be achieved with a QueueTaskDispatcher
  4. If the item (or any child item) has SCM polling, you need to ensure that polling is not currently taking place (because that requires writing to the polling log for the corresponding item)
  5. If the item (or any child item) has Post-commit Hooks, you need to ensure that none of the post-commit hooks will try and log their progress to a log file in the item
  6. If there are additional plugins that store state in side-files belonging to the item, you need to ensure that none of those plugins are trying to write the data

What is required is a multi-level lock service that is aware of items and item groups.

Lock types required:

Most existing use in Jenkins would be of the Soft Read / Soft Write variety.


Originally reported by stephenconnolly, imported from: Need an extension point to provide read/write locks on item storage locations
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 7 years ago

scm_issue_link:

Code changed in jenkins
User: Stephen Connolly
Path:
src/main/java/com/cloudbees/hudson/plugins/folder/computed/EventOutputStreams.java
src/main/java/com/cloudbees/hudson/plugins/folder/computed/FolderComputation.java
http://jenkins-ci.org/commit/cloudbees-folder-plugin/f68bc6367678116d7b3b7982076e7473b7ae4410
Log:
JENKINS-42151 Noting that may be affected by JENKINS-42248 in the future