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

ProcessTreeKiller broken for Windows when node went offline/online

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Duplicate
    • core
    • Jenkins 1.625.1 LTS
      Window7,Window8,Window10 node
      JDK 1.7

    Description

      1) Choose a Windows7/8/10 node and mark it offline in its configuration page
      2) then mark it online
      3) Create a job attached to this node with the Windows command: notepad.exe
      4) Start your job, check that Notepad is started (dont close).
      5) Cancel the build of the job and see that Notepad is still open.

      On the windows node, if you manually restart the agent, this fixes the "kill behavior".

      the problem also happens for an accidental deconnection/reconnection (that how we notificed that, because randomly it seems that the ProcessTreeKiller did not work anymore and it seemed that it happened after networks issues between the server and the node)

      Attachments

        Issue Links

          Activity

            sgalles Stephane Gallès created issue -
            sgalles Stephane Gallès made changes -
            Field Original Value New Value
            Description 1) Choose a Windows7/8/10 node and mark it offline in its configuration page
            2) then mark it online
            3) Create a job attached to this node with the Windows command: notepad.exe
            4) Start your job, check that Notepad is started (dont close).
            5) Cancel the build of the job and see that Notepad is still open.

            On the windows node, if you manually restart the agent, this fixes the "kill behavior".

            the problem also happens for an accidental deconnection/reconnection (that how we've notificed that, because randomly it seems that the ProcessTreeKiller did not work anymore and it seemed that it happened after networks issues between the server and the node)
            1) Choose a Windows7/8/10 node and mark it offline in its configuration page
            2) then mark it online
            3) Create a job attached to this node with the Windows command: notepad.exe
            4) Start your job, check that Notepad is started (dont close).
            5) Cancel the build of the job and see that Notepad is still open.

            On the windows node, if you manually restart the agent, this fixes the "kill behavior".

            the problem also happens for an accidental deconnection/reconnection (that how we notificed that, because randomly it seems that the ProcessTreeKiller did not work anymore and it seemed that it happened after networks issues between the server and the node)

            Error reproduced :

            Slave agent is launch by a script containing such command : javaws http://localhost:8080/jenkins/computer/NODE/slave-agent.jnlp
            Job consists in a Windows Batch command : notepad.exe.

            Analysis :
            When disconnecting node using the jenkins UI, the slave-agent is set disconnected and then it restarts.
            The submitting a new job and cancelling it with the UI causes an Error in Class hudson.util.ProcessTree method "public static ProcessTree get()" @line:355
            java.lang.UnsatisfiedLinkError: Native Library C:\Users\<user_name>\.jenkins\cache\jars\4A\winp.x64.22D9AB310A3FA2D96B6E03A836A47724.dll already loaded in another classloader
            When this Error is catched, ProcessTreeKiller enable static attribute is set to false, then DEFAULT ProcessTree imlementation is used, where killAll is no-op. So only ProcessRuntime running the cmd command is destroyed and only cmd process is killed (which doesn't kill the subprocesses)

            pcazes Pierre-Henri Cazes added a comment - Error reproduced : Slave agent is launch by a script containing such command : javaws http://localhost:8080/jenkins/computer/NODE/slave-agent.jnlp Job consists in a Windows Batch command : notepad.exe. Analysis : When disconnecting node using the jenkins UI, the slave-agent is set disconnected and then it restarts. The submitting a new job and cancelling it with the UI causes an Error in Class hudson.util.ProcessTree method "public static ProcessTree get()" @line:355 java.lang.UnsatisfiedLinkError: Native Library C:\Users\<user_name>\.jenkins\cache\jars\4A\winp.x64.22D9AB310A3FA2D96B6E03A836A47724.dll already loaded in another classloader When this Error is catched, ProcessTreeKiller enable static attribute is set to false, then DEFAULT ProcessTree imlementation is used, where killAll is no-op. So only ProcessRuntime running the cmd command is destroyed and only cmd process is killed (which doesn't kill the subprocesses)
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 167146 ] JNJira + In-Review [ 182610 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels winp
            oleg_nenashev Oleg Nenashev added a comment -

            Merging the issue into JENKINS-24319

            oleg_nenashev Oleg Nenashev added a comment - Merging the issue into JENKINS-24319
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is related to JENKINS-24319 [ JENKINS-24319 ]
            oleg_nenashev Oleg Nenashev made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]

            People

              Unassigned Unassigned
              sgalles Stephane Gallès
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: