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

SSH Agent Plugin - Infinite Thread - Thread Hangs - Thread stuck

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • ssh-agent-plugin
    • None
    • Unix/RedHat6.5/Jenkins1.568/SSHClient 1.4.1

      For every build, SSH Client plugin create a thread that never ends.
      It seems to come from this class :
      com/cloudbees/jenkins/plugins/sshagent/jna/AgentServer.java

      AgentServer.java
      thread = new Thread() {
          public void run() {
              try {
                  while (!stopped) {
                      final UnixSocketChannel clientSock = channel.accept();
                      clientSock.configureBlocking(true);
                      new SshAgentSession(clientSock, agent);
                  }
              } catch (Exception e) {
                  if (!stopped) {
                      e.printStackTrace();
                  }
              }
          }
      };
      

      I do not really understand the while loop necessity here. The thread will hang in the "channel.accept()" method only the second time it passes in.

      Here is the stack :

      "Thread-2000" prio=10 tid=0x0000000040e2f800 nid=0x527e runnable [0x00007ff5ec313000]
      java.lang.Thread.State: RUNNABLE
      at com.kenai.jffi.Foreign.invokeN3O2(Native Method)
      at com.kenai.jffi.Invoker.invokeN3(Invoker.java:1092)
      at jnr.unixsocket.Native$LibC$jnr$ffi$0.accept(Unknown Source)
      at jnr.unixsocket.Native.accept(Native.java:91)
      at jnr.unixsocket.UnixServerSocketChannel.accept(UnixServerSocketChannel.java:56)
      at com.cloudbees.jenkins.plugins.sshagent.jna.AgentServer$1.run(AgentServer.java:77)

            Unassigned Unassigned
            tetra Thomas Carsuzan
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: