Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17116

gracefull job termination

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Environment:
      any
    • Similar Issues:

      Description

      Using the freestyle projects to execute bash shell scripts work fine. But cancelling a jenkins job seems to use SIGKILL. In this way the script cannot perform cleanup operations and free resources.

      SIGKILL cannot be handled by shell

      SIGINT/SIGTERM are not used by jenkins

      Preferred: SIGINT -> wait 5 seconds -> SIGKILL

        Attachments

          Issue Links

            Activity

            Hide
            sreiter Stephan Reiter added a comment -

            Cool, Rahul.  We've been working around it for 4 years. But now we got tired of the performance penalty the workarounds introduce for us, so I said: How hard can it be (to fix the problem)? Turns out, not hard. Just getting it done is. sigh

            Show
            sreiter Stephan Reiter added a comment - Cool, Rahul.  We've been working around it for 4 years. But now we got tired of the performance penalty the workarounds introduce for us, so I said: How hard can it be (to fix the problem)? Turns out, not hard. Just getting it done is. sigh
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I believe it is going to land in the next weekly

            Show
            oleg_nenashev Oleg Nenashev added a comment - I believe it is going to land in the next weekly
            Show
            hashar Antoine Musso added a comment - The merge https://github.com/jenkinsci/jenkins/commit/d8eac92ee9a1c19bf145763589f1c152607bf3ed is in tag jenkins-2.141
            Hide
            deepchip Martin d'Anjou added a comment - - edited

            With Jenkins 2.141, I ran the bash script, and the python script and there is no change. Jenkins still leaks processes, and still the signals are not trapped by the user script. The is one difference though, the first click on the terminate button (the red [x]) does not kill the job immediately, but that seems to change nothing.

            Show
            deepchip Martin d'Anjou added a comment - - edited With Jenkins 2.141, I ran the bash script , and the python script and there is no change. Jenkins still leaks processes, and still the signals are not trapped by the user script. The is one difference though, the first click on the terminate button (the red  [x] ) does not kill the job immediately, but that seems to change nothing.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Martin d'Anjou Leaking of processes is unrelated to this fix.

            Usual causes:

            • You use 32bit-Java on a 64bit machine
            • You use tool wrappers like Cygwin which mess up the process tree in Windows (See the Cygwin Process Killer plugin)
            • The processes are spawned without inheriting Build reference variables, so the library cannot pick them up if parent processes are already aborted, and the process is orphaned

            I suggest creating a separate issue if none of the above is your case

             

             

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - Martin d'Anjou Leaking of processes is unrelated to this fix. Usual causes: You use 32bit-Java on a 64bit machine You use tool wrappers like Cygwin which mess up the process tree in Windows (See the Cygwin Process Killer plugin) The processes are spawned without inheriting Build reference variables, so the library cannot pick them up if parent processes are already aborted, and the process is orphaned I suggest creating a separate issue if none of the above is your case      

              People

              • Assignee:
                robinjarry Robin Jarry
                Reporter:
                markusb Markus Breuer
              • Votes:
                35 Vote for this issue
                Watchers:
                47 Start watching this issue

                Dates

                • Created:
                  Updated: