jenkinsci / jenkinsfile-runner

A command line tool to run Jenkinsfile as a function
MIT License
1.13k stars 292 forks source link

Interrupt any running build if the JFR JVM exits cleanly #541

Open jglick opened 3 years ago

jglick commented 3 years ago

Untested, but should offer better cleanup behavior in case the Pipeline is using any external resources.

jglick commented 3 years ago

why JFR behavior for Pipeline termination should be different from classic Jenkins

Because in a Jenkins server, exiting should not interrupt running Pipelines. That would obviate all the durability features of Pipeline! Whereas if a JFR container dies for whatever reason while a build was in progress, clearly that build is going to die as well, so you should give it the chance to clean up a bit: send any “aborted” notifications, release locks on external services, whatever.

To be more useful, this should probably wait (up to ~10s) for the build to terminate on its own. The current code sends an abort signal but then allows JVM shutdown to proceed in parallel.

jglick commented 3 years ago

proceed with Jenkins Pipeline execution when used in the CLI mode with external JENKINS_HOME

Sorry, what?