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

Jenkins Timer threads could get a bogus classLoader

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      The Timer threads are lazily created by its executorService, so if an invocation to the Timer threads is made in a Thread context with a different contextClassloader than the default, the Timer thread will receive this contextClassloader.

      Noted when fixing an analogous error in the Pipeline Timeout utility https://github.com/jenkinsci/workflow-support-plugin/pull/53 jglick – that error caused a Groovy memory leak. 

          [JENKINS-49206] Jenkins Timer threads could get a bogus classLoader

          Sam Van Oort created issue -
          Sam Van Oort made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 3272 (Web Link)" [ 19966 ]
          Jesse Glick made changes -
          Labels New: robustness
          Sam Van Oort made changes -
          Remote Link New: This issue links to "Core PR #3272 (Web Link)" [ 19967 ]
          Sam Van Oort made changes -
          Remote Link Original: This issue links to "Core PR #3272 (Web Link)" [ 19967 ]

          Code changed in jenkins
          User: Sam Van Oort
          Path:
          core/src/main/java/hudson/util/ClassLoaderSanityThreadFactory.java
          core/src/main/java/jenkins/util/Timer.java
          core/src/test/java/jenkins/util/TimerTest.java
          http://jenkins-ci.org/commit/jenkins/2a6fc653ee7b13adde18515b21f7e6dc1200fa8a
          Log:
          Fix JENKINS-49206 by ensuring Timer threads get standard classloader (#3272)

          • Fix JENKINS-49206 by ensuring Timer threads get standard classloader
          • Refactor to better fit in with existing ThreadFactor utils
          • Fix javadocs

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sam Van Oort Path: core/src/main/java/hudson/util/ClassLoaderSanityThreadFactory.java core/src/main/java/jenkins/util/Timer.java core/src/test/java/jenkins/util/TimerTest.java http://jenkins-ci.org/commit/jenkins/2a6fc653ee7b13adde18515b21f7e6dc1200fa8a Log: Fix JENKINS-49206 by ensuring Timer threads get standard classloader (#3272) Fix JENKINS-49206 by ensuring Timer threads get standard classloader Refactor to better fit in with existing ThreadFactor utils Fix javadocs

          Oleg Nenashev added a comment -

          It has been released in Jenkins 2.105, so that it will become available in 2.107.1 LTS

          Oleg Nenashev added a comment - It has been released in Jenkins 2.105, so that it will become available in 2.107.1 LTS
          Oleg Nenashev made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

            svanoort Sam Van Oort
            svanoort Sam Van Oort
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: