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

Pegged CPU by writeSymlink calls

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: core
    • Environment:
      Jenkins 1.532 + backports to stable
      Windows Server 2008 R2
    • Similar Issues:

      Description

      I'm getting cpu stuck at 100% when a lot of executor threads are updating permalinks

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/jenkins/model/PeepholePermalink.java
          http://jenkins-ci.org/commit/jenkins/f768fb7aed02bf4e944eff10cb2ba3007d98e560
          Log:
          JENKINS-20534 Avoid usage of temporary file to write symlink.

          Creating a symlink is an atomic operation, and additionally
          usage of tmp file + rename performs very badly on NTFS file
          system because of the way the rename is tracked in the $MFT.

          In case symbolic links are not supported, we still fallback to
          a regular file.

          (cherry picked from commit c0742b8bff9fe407e568da7ed860f30d9ea8aedc)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/jenkins/model/PeepholePermalink.java http://jenkins-ci.org/commit/jenkins/f768fb7aed02bf4e944eff10cb2ba3007d98e560 Log: JENKINS-20534 Avoid usage of temporary file to write symlink. Creating a symlink is an atomic operation, and additionally usage of tmp file + rename performs very badly on NTFS file system because of the way the rename is tracked in the $MFT. In case symbolic links are not supported, we still fallback to a regular file. (cherry picked from commit c0742b8bff9fe407e568da7ed860f30d9ea8aedc)
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #3192
          JENKINS-20534 Avoid usage of temporary file to write symlink. (Revision c0742b8bff9fe407e568da7ed860f30d9ea8aedc)
          [FIXED JENKINS-20534] Noting merge of #1057. (Revision 5c83c64e7af95bc5f216d841e4257c79403931d8)

          Result = SUCCESS
          Vincent Latombe : c0742b8bff9fe407e568da7ed860f30d9ea8aedc
          Files :

          • core/src/main/java/jenkins/model/PeepholePermalink.java

          Jesse Glick : 5c83c64e7af95bc5f216d841e4257c79403931d8
          Files :

          • changelog.html
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3192 JENKINS-20534 Avoid usage of temporary file to write symlink. (Revision c0742b8bff9fe407e568da7ed860f30d9ea8aedc) [FIXED JENKINS-20534] Noting merge of #1057. (Revision 5c83c64e7af95bc5f216d841e4257c79403931d8) Result = SUCCESS Vincent Latombe : c0742b8bff9fe407e568da7ed860f30d9ea8aedc Files : core/src/main/java/jenkins/model/PeepholePermalink.java Jesse Glick : 5c83c64e7af95bc5f216d841e4257c79403931d8 Files : changelog.html
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Marked the issue as lts-candidate

          Show
          oleg_nenashev Oleg Nenashev added a comment - Marked the issue as lts-candidate
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/5c83c64e7af95bc5f216d841e4257c79403931d8
          Log:
          [FIXED JENKINS-20534] Noting merge of #1057.

          Compare: https://github.com/jenkinsci/jenkins/compare/da8eba20babf...5c83c64e7af9

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html http://jenkins-ci.org/commit/jenkins/5c83c64e7af95bc5f216d841e4257c79403931d8 Log: [FIXED JENKINS-20534] Noting merge of #1057. Compare: https://github.com/jenkinsci/jenkins/compare/da8eba20babf...5c83c64e7af9
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/jenkins/model/PeepholePermalink.java
          http://jenkins-ci.org/commit/jenkins/c0742b8bff9fe407e568da7ed860f30d9ea8aedc
          Log:
          JENKINS-20534 Avoid usage of temporary file to write symlink.

          Creating a symlink is an atomic operation, and additionally
          usage of tmp file + rename performs very badly on NTFS file
          system because of the way the rename is tracked in the $MFT.

          In case symbolic links are not supported, we still fallback to
          a regular file.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/jenkins/model/PeepholePermalink.java http://jenkins-ci.org/commit/jenkins/c0742b8bff9fe407e568da7ed860f30d9ea8aedc Log: JENKINS-20534 Avoid usage of temporary file to write symlink. Creating a symlink is an atomic operation, and additionally usage of tmp file + rename performs very badly on NTFS file system because of the way the rename is tracked in the $MFT. In case symbolic links are not supported, we still fallback to a regular file.
          Hide
          vlatombe Vincent Latombe added a comment -

          PR to avoid renaming of symlinks
          https://github.com/jenkinsci/jenkins/pull/1057

          Show
          vlatombe Vincent Latombe added a comment - PR to avoid renaming of symlinks https://github.com/jenkinsci/jenkins/pull/1057
          Hide
          vlatombe Vincent Latombe added a comment - - edited

          A significant number of threads seem to take time during rename of the cache file. Corresponding disk queues don't seem stressed at all, it only has a CPU impact.

          java.lang.Thread.State: RUNNABLE
          	at java.io.WinNTFileSystem.rename0(Native Method)
          	at java.io.Win32FileSystem.rename(Win32FileSystem.java:535)
          	at java.io.File.renameTo(File.java:1391)
          	at jenkins.model.PeepholePermalink.writeSymlink(PeepholePermalink.java:185)
          	at jenkins.model.PeepholePermalink.updateCache(PeepholePermalink.java:142)
          	at jenkins.model.PeepholePermalink$RunListenerImpl.onCompleted(PeepholePermalink.java:219)
          	at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
          	at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:574)
          
          Show
          vlatombe Vincent Latombe added a comment - - edited A significant number of threads seem to take time during rename of the cache file. Corresponding disk queues don't seem stressed at all, it only has a CPU impact. java.lang. Thread .State: RUNNABLE at java.io.WinNTFileSystem.rename0(Native Method) at java.io.Win32FileSystem.rename(Win32FileSystem.java:535) at java.io.File.renameTo(File.java:1391) at jenkins.model.PeepholePermalink.writeSymlink(PeepholePermalink.java:185) at jenkins.model.PeepholePermalink.updateCache(PeepholePermalink.java:142) at jenkins.model.PeepholePermalink$RunListenerImpl.onCompleted(PeepholePermalink.java:219) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:574)

            People

            Assignee:
            vlatombe Vincent Latombe
            Reporter:
            vlatombe Vincent Latombe
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: