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

Jenkins Not Closing Filehandles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • CentOS 6.4
      Jenkins-CI 1.509.2
      vSphere Cloud Plugin 0.10
      Jenkins SSH Slaves plugin 0.27

      I received the following error when Jenkins was attempting to connect to a slave via SSH.

      [SLAVE] Starting Virtual Machine...[SLAVE] Reverting to snapshot:jenkins_test[SLAVE] Powering on VM[SLAVE] Waiting for VMTools[SLAVE] Finished wait for VMTools[07/30/13 05:30:59] [SSH] Opening SSH connection to SLAVE:22.
      [07/30/13 05:30:59] [SSH] Authentication successful.
      ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
      java.lang.OutOfMemoryError: unable to create new native thread
      at java.lang.Thread.start0(Native Method)
      at java.lang.Thread.start(Thread.java:691)
      at com.trilead.ssh2.Connection.exec(Connection.java:1520)
      at hudson.plugins.sshslaves.SSHLauncher.verifyNoHeaderJunk(SSHLauncher.java:608)
      at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:490)
      at org.jenkinsci.plugins.vSphereCloudLauncher.launch(vSphereCloudLauncher.java:198)
      at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:222)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)
      [07/30/13 05:30:59] [SSH] Connection closed.

      This was being caused by Jenkins attempting to exceed the number of filehandles it was allowed by the system. This seems to be caused by Jenkins not releasing the TCP connection to the slave box when there is no traffic between the boxes.

      Our current setup using the vSphere Cloud Plugin is to start a job on that slave and when it is completed rollback to a previous snapshot and connect to the slave again. Each time this occurs Jenkins opens a new TCP connection but never releases the old one. The only way to clear these is to restart the application.

      java 22547 jenkins 365w IPv4 110621531 0t0 TCP jenkinsmaster:58371->jenkinsslave:ssh (ESTABLISHED)
      java 22547 jenkins 367u IPv4 110611457 0t0 TCP jenkinsmaster:58020->jenkinsslave:ssh (ESTABLISHED)
      java 22547 jenkins 368u IPv4 110612511 0t0 TCP jenkinsmaster:58038->jenkinsslave:ssh (ESTABLISHED)
      java 22547 jenkins 369u IPv4 110616112 0t0 TCP jenkinsmaster:58072->jenkinsslave:ssh (ESTABLISHED)
      java 22547 jenkins 371u IPv4 110585709 0t0 TCP jenkinsmaster:57697->jenkinsslave:ssh (ESTABLISHED)
      java 22547 jenkins 372u IPv4 110625368 0t0 TCP jenkinsmaster:58552->jenkinsslave:ssh (ESTABLISHED)
      java 22547 jenkins 421u IPv4 110629766 0t0 TCP jenkinsmaster:58578->jenkinsslave:ssh (ESTABLISHED)

            kohsuke Kohsuke Kawaguchi
            tgraham Travis Graham
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: