Skip to content

Conversation

@strangelookingnerd
Copy link
Contributor

My initial implementation of JenkinsRule#restart in #716 seems to be flawed in a sense that the underlying Jenkins instance is restored with a copy of the original JENKINS_HOME under a new path.

In jenkinsci/throttle-concurrent-builds-plugin#302 in became clear that this impacts some corner cases where this path is actually relevant for some plugins (see jenkinsci/throttle-concurrent-builds-plugin#302 (comment)).

This PR aims to remove this flaw. Now JenkinsRule#restart will start a new instance with a copy of the original JENKINS_HOME under the same path as the previous instance. This is achieved by creating a backup.zip from the current JENKINS_HOME before shutting it down and starting a new instance from the unzipped backup that has the same path as before.

I do not assume that this change will cause any incompatibilities as I can not find evidence of a tests validating / building upon the flaws of the initial implementation.

Ping @basil @jglick Your input would be very welcome.

Testing done

Adapted the existing tests.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@timja timja added the bug label Mar 25, 2025
@timja timja merged commit eb6b5e5 into jenkinsci:master Mar 25, 2025
15 checks passed
@strangelookingnerd strangelookingnerd deleted the jenkins_restart_same_root branch March 25, 2025 12:24
@jglick
Copy link
Member

jglick commented Mar 27, 2025

creating a backup.zip from the current JENKINS_HOME before shutting it down and starting a new instance from the unzipped backup

Sounds better, though still inferior to JenkinsSessionRule which does not need to touch files at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants