Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-60434] Allow pipelines to continue running when preparing for shutdown #846

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajkyffin
Copy link

@ajkyffin ajkyffin commented Feb 9, 2024

Prevents pipelines from being paused when preparing for shutdown. No new parts of pipelines are scheduled to executors but parts already running can run to completion, allowing Jenkins to be restarted without any running jobs.

This is disabled by default and enabled by setting -Dorg.jenkinsci.plugins.workflow.cps.CpsThreadGroup.keepPipelinesRunningWhenQuietingDown=true.

This provides a solution for https://issues.jenkins.io/browse/JENKINS-60434.

Testing done

The default case is covered by existing tests in CpsFlowExecutionTest.java.

For the case with -Dorg.jenkinsci.plugins.workflow.cps.CpsThreadGroup.keepPipelinesRunningWhenQuietingDown=true:

  • tested that pipelines are not automatically pause when preparing for shutdown
  • tested manually pausing and resuming a pipeline
  • tested manually pausing and resuming a pipeline while preparing for shutdown
  • tested preparing for shutdown, allowing a pipeline to run to the end of it's current node section, and restarting Jenkins. The pipeline resumed at the next node section as expected.

Submitter checklist

Preview Give feedback

@ajkyffin ajkyffin requested a review from a team as a code owner February 9, 2024 16:58
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely functionally incomplete, deserves some test coverage, and ought to be an explicit option at the GUI (or CLI etc.) level rather than a system property. See discussion in Jira.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants