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

Remoting deadlock when launching remote agent

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • core
    • Jenkins 2.238

    Description

      After launching an agent it keeps hanging with the following text :

       

      [05/06/20 20:34:24] [SSH] Starting agent process: cd "/var/lib/jenkins" && java -jar remoting.jar -workDir /var/lib/jenkins May 06, 2020 8:34:25 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir INFO: Using /var/lib/jenkins/remoting as a remoting work directory May 06, 2020 8:34:25 PM org.jenkinsci.remoting.engine.WorkDirManager setupLogging INFO: Both error and output logs will be printed to /var/lib/jenkins/remoting <===[JENKINS REMOTING CAPACITY]===>channel started Remoting version: 4.3 This is a Unix agent

       

      This happens since a couple of weeks

       

      jstack reports a deadlock in attachment :

       

      Found one Java-level deadlock:
      =============================
      "pool-1-thread-4 for channel id=17236":
      waiting to lock monitor 0x00007fbd8c015bc8 (object 0x000000076e658428, a hudson.slaves.SlaveComputer$SlaveInitializer$1),
      which is held by "Channel reader thread: channel"
      "Channel reader thread: channel":
      waiting to lock monitor 0x00007fbd9401aed8 (object 0x000000076ded1cc8, a hudson.remoting.RemoteClassLoader),
      which is held by "pool-1-thread-4 for channel id=17236"

       

      On april 3 2020 in commit https://github.com/jenkinsci/jenkins/commit/3262d8b7cfbdd1a2e026ad34644e0f9607f5724d  

      a new synchronized  method was added that is partly the cause of this deadlock .See line 1026 in main/java/hudson/slaves/SlaveComputer.java 

       

       

       

      Attachments

        Issue Links

          Activity

            danielbeck Daniel Beck added a comment -

            FYI jglick since your change is mentioned.

            danielbeck Daniel Beck added a comment - FYI jglick since your change is mentioned.
            jglick Jesse Glick added a comment -

            The “new” method was just an override of an existing synchronized method, though the deadlock does smell like a regression in the new code before the super call.

            You have a custom logger on hudson.remoting.Channel (or hudson.remoting) at FINE or below I think? As a workaround, try removing that logger.

            jglick Jesse Glick added a comment - The “new” method was just an override of an existing synchronized method, though the deadlock does smell like a regression in the new code before the super call. You have a custom logger on hudson.remoting.Channel (or hudson.remoting ) at FINE or below I think? As a workaround, try removing that logger.
            oleg_nenashev Oleg Nenashev added a comment -

            The fix was released in Jenkins 2.238

            oleg_nenashev Oleg Nenashev added a comment - The fix was released in Jenkins 2.238
            beslbx Brian Besl added a comment -

            We are still suffering from what appears to be this issue.  Both on 2.235.1 and 2.243.

            The agent hang is the same as reported.  But I don't know how for the java deadlock originally reported. 

            beslbx Brian Besl added a comment - We are still suffering from what appears to be this issue.  Both on 2.235.1 and 2.243. The agent hang is the same as reported.  But I don't know how for the java deadlock originally reported. 
            jglick Jesse Glick added a comment -

            beslbx better to file a distinct issue and perhaps Link to this one. Unless the deadlock details match those here, you are probably seeing something unrelated.

            jglick Jesse Glick added a comment - beslbx better to file a distinct issue and perhaps Link to this one. Unless the deadlock details match those here, you are probably seeing something unrelated.
            marcus_phi Marcus Philip added a comment -

            A very similar problem seems to still occur. See JENKINS-63082.

            marcus_phi Marcus Philip added a comment - A very similar problem seems to still occur. See  JENKINS-63082 .

            People

              jglick Jesse Glick
              bheupers Bart Heupers
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: