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

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

@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
2 participants