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

DirectoryBrowserSupport.buildChildPaths does quadratic number of calls to check whether entries are directories

      From a thread dump when the workspace browser was timing out trying to show me a directory:

      "Handling GET /job/.../ws/test/target/surefire-reports/ : ... / waiting for hudson.remoting.Channel@..." Id=... Group=main TIMED_WAITING on hudson.remoting.UserRequest@...
      	at java.lang.Object.wait(Native Method)
      	-  waiting on hudson.remoting.UserRequest@280e3332
      	at hudson.remoting.Request.call(Request.java:146)
      	at hudson.remoting.Channel.call(Channel.java:714)
      	at hudson.FilePath.act(FilePath.java:905)
      	at hudson.FilePath.act(FilePath.java:889)
      	at hudson.FilePath.isDirectory(FilePath.java:1389)
      	at jenkins.util.VirtualFile$2.isDirectory(VirtualFile.java:266)
      	at hudson.model.DirectoryBrowserSupport$FileComparator.dirRank(DirectoryBrowserSupport.java:443)
      	at hudson.model.DirectoryBrowserSupport$FileComparator.compare(DirectoryBrowserSupport.java:435)
      	at hudson.model.DirectoryBrowserSupport$FileComparator.compare(DirectoryBrowserSupport.java:426)
      	at java.util.TimSort.mergeHi(Unknown Source)
      	at java.util.TimSort.mergeAt(Unknown Source)
      	at java.util.TimSort.mergeCollapse(Unknown Source)
      	at java.util.TimSort.sort(Unknown Source)
      	at java.util.TimSort.sort(Unknown Source)
      	at java.util.Arrays.sort(Unknown Source)
      	at hudson.model.DirectoryBrowserSupport.buildChildPaths(DirectoryBrowserSupport.java:460)
      	at hudson.model.DirectoryBrowserSupport.serveFile(DirectoryBrowserSupport.java:254)
      	at hudson.model.DirectoryBrowserSupport.generateResponse(DirectoryBrowserSupport.java:123)
      

          [JENKINS-21780] DirectoryBrowserSupport.buildChildPaths does quadratic number of calls to check whether entries are directories

          Jesse Glick added a comment -

          Original fix did not help, revising.

          Jesse Glick added a comment - Original fix did not help, revising.

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          http://jenkins-ci.org/commit/jenkins/f61086b56cece14810ebc755feb1c08e7790cc8f
          Log:
          Revert "[FIXED JENKINS-21780] DirectoryBrowserSupport.FileComparator should cache isDirectory calls."

          This reverts commit ab54f136ca66dc0a29886c5dc94851adeb166356.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/model/DirectoryBrowserSupport.java http://jenkins-ci.org/commit/jenkins/f61086b56cece14810ebc755feb1c08e7790cc8f Log: Revert " [FIXED JENKINS-21780] DirectoryBrowserSupport.FileComparator should cache isDirectory calls." This reverts commit ab54f136ca66dc0a29886c5dc94851adeb166356.

          Daniel Beck added a comment -

          (Restoring Reopened state and replacing 1.532.3-fixed with lts-candidate)

          Daniel Beck added a comment - (Restoring Reopened state and replacing 1.532.3-fixed with lts-candidate )

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          http://jenkins-ci.org/commit/jenkins/e51fdbbc0e74f14aceef9f4e9729fc33e300bbc3
          Log:
          [FIXED JENKINS-21780] Revised fix to make cache work properly without introducing a new remote call to find hash codes.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/DirectoryBrowserSupport.java http://jenkins-ci.org/commit/jenkins/e51fdbbc0e74f14aceef9f4e9729fc33e300bbc3 Log: [FIXED JENKINS-21780] Revised fix to make cache work properly without introducing a new remote call to find hash codes.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          core/src/main/java/jenkins/util/VirtualFile.java
          http://jenkins-ci.org/commit/jenkins/6fe5d6c6bab63998b11a3b987c57f59a928c965e
          Log:
          JENKINS-21780 Much more effective fix.
          Introduce VirtualFile.run method to batch together commands.
          This should restore pre-ArtifactManager performance for workspace browsing.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/DirectoryBrowserSupport.java core/src/main/java/jenkins/util/VirtualFile.java http://jenkins-ci.org/commit/jenkins/6fe5d6c6bab63998b11a3b987c57f59a928c965e Log: JENKINS-21780 Much more effective fix. Introduce VirtualFile.run method to batch together commands. This should restore pre-ArtifactManager performance for workspace browsing.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3200
          [FIXED JENKINS-21780] Revised fix to make cache work properly without introducing a new remote call to find hash codes. (Revision e51fdbbc0e74f14aceef9f4e9729fc33e300bbc3)
          JENKINS-21780 Much more effective fix. (Revision 6fe5d6c6bab63998b11a3b987c57f59a928c965e)

          Result = UNSTABLE
          Jesse Glick : e51fdbbc0e74f14aceef9f4e9729fc33e300bbc3
          Files :

          • changelog.html
          • core/src/main/java/hudson/model/DirectoryBrowserSupport.java

          Jesse Glick : 6fe5d6c6bab63998b11a3b987c57f59a928c965e
          Files :

          • core/src/main/java/jenkins/util/VirtualFile.java
          • core/src/main/java/hudson/model/DirectoryBrowserSupport.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3200 [FIXED JENKINS-21780] Revised fix to make cache work properly without introducing a new remote call to find hash codes. (Revision e51fdbbc0e74f14aceef9f4e9729fc33e300bbc3) JENKINS-21780 Much more effective fix. (Revision 6fe5d6c6bab63998b11a3b987c57f59a928c965e) Result = UNSTABLE Jesse Glick : e51fdbbc0e74f14aceef9f4e9729fc33e300bbc3 Files : changelog.html core/src/main/java/hudson/model/DirectoryBrowserSupport.java Jesse Glick : 6fe5d6c6bab63998b11a3b987c57f59a928c965e Files : core/src/main/java/jenkins/util/VirtualFile.java core/src/main/java/hudson/model/DirectoryBrowserSupport.java

          Alex Ouzounis added a comment -

          Is this fix present in the latest version ?

          We are also getting hit by it.

          Alex Ouzounis added a comment - Is this fix present in the latest version ? We are also getting hit by it.

          Daniel Beck added a comment -

          Alex Ouzounis: Try http://jenkins-ci.org/changelog ("upcoming changes" might be interesting)

          Daniel Beck added a comment - Alex Ouzounis: Try http://jenkins-ci.org/changelog ("upcoming changes" might be interesting)

          Alex Ouzounis added a comment -

          Aha!

          Yes, indeed. Its part of 1.554

          Thanks for the quick reply

          Alex

          Alex Ouzounis added a comment - Aha! Yes, indeed. Its part of 1.554 Thanks for the quick reply Alex

          Daniel Beck added a comment -

          May have caused JENKINS-22514

          Daniel Beck added a comment - May have caused JENKINS-22514

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: