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

Support bundle blocks with lots of log data

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The SupportLogFormatter.format could potential cause a performance issue if there is lots of log information being printed. I have only seen this issue happen if the log content is over 16MB in size, or lots of log data is being sent.

      Thread dumps

      Blocking thread:

      Thread 15139: (state = IN_VM)
       - java.lang.Throwable.fillInStackTrace(int) @bci=0 (Compiled frame; information may be imprecise)
       - java.lang.Throwable.fillInStackTrace() @bci=16, line=782 (Compiled frame)
       - java.lang.Throwable.<init>() @bci=24, line=250 (Compiled frame)
       - java.util.logging.LogRecord.inferCaller() @bci=13, line=528 (Compiled frame)
       - java.util.logging.LogRecord.getSourceMethodName() @bci=8, line=336 (Compiled frame)
       - com.cloudbees.jenkins.support.SupportLogFormatter.format(java.util.logging.LogRecord) @bci=73, line=55 (Compiled frame)
       - java.util.logging.StreamHandler.publish(java.util.logging.LogRecord) @bci=14, line=196 (Compiled frame)
       - com.cloudbees.jenkins.support.impl.JenkinsLogs$LogFile.publish(java.util.logging.LogRecord) @bci=58, line=497 (Compiled frame)
       - com.cloudbees.jenkins.support.impl.JenkinsLogs$CustomHandler.publish(java.util.logging.LogRecord) @bci=171, line=536 (Compiled frame)
       - java.util.logging.Logger.log(java.util.logging.LogRecord) @bci=82, line=610 (Compiled frame)
       - java.util.logging.Logger.doLog(java.util.logging.LogRecord) @bci=43, line=631 (Compiled frame)
       - java.util.logging.Logger.log(java.util.logging.Level, java.lang.String) @bci=34, line=654 (Compiled frame)
       - java.util.logging.Logger.fine(java.lang.String) @bci=19, line=1204 (Compiled frame)
      

      Blocked threads:

      Thread 15140: (state = BLOCKED)
       - java.util.logging.StreamHandler.publish(java.util.logging.LogRecord) @bci=0, line=191 (Compiled frame)
       - com.cloudbees.jenkins.support.impl.JenkinsLogs$LogFile.publish(java.util.logging.LogRecord) @bci=58, line=497 (Compiled frame)
       - com.cloudbees.jenkins.support.impl.JenkinsLogs$CustomHandler.publish(java.util.logging.LogRecord) @bci=171, line=536 (Compiled frame)
       - java.util.logging.Logger.log(java.util.logging.LogRecord) @bci=82, line=610 (Compiled frame)
       - java.util.logging.Logger.doLog(java.util.logging.LogRecord) @bci=43, line=631 (Compiled frame)
       - java.util.logging.Logger.log(java.util.logging.Level, java.lang.String, java.lang.Object[]) @bci=42, line=695 (Compiled frame)
      

      CCing Jesse Glick as e14849 might be triggering this issue.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Probably date, formatter, and args (all of which have state that should not be accessed concurrently) could be pulled out into a private helper class, of which one per thread would be used, retrieved via ThreadLocal.

            Show
            jglick Jesse Glick added a comment - Probably date , formatter , and args (all of which have state that should not be accessed concurrently) could be pulled out into a private helper class, of which one per thread would be used, retrieved via ThreadLocal .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: christ66
            Path:
            src/main/java/com/cloudbees/jenkins/support/SupportLogFormatter.java
            http://jenkins-ci.org/commit/support-core-plugin/666dd1ddd1f924150ee5cd2cc92dd0d6a9f0f117
            Log:
            JENKINS-30117 Support bundle blocks with lots of data

            The format method should be thread safe as it could be invoked from
            multiple threads. Instead of using a MessageFormatter which is not thread safe we
            use the FastDateFormatter, and a StringBuffer both of which are thread
            safe.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/main/java/com/cloudbees/jenkins/support/SupportLogFormatter.java http://jenkins-ci.org/commit/support-core-plugin/666dd1ddd1f924150ee5cd2cc92dd0d6a9f0f117 Log: JENKINS-30117 Support bundle blocks with lots of data The format method should be thread safe as it could be invoked from multiple threads. Instead of using a MessageFormatter which is not thread safe we use the FastDateFormatter, and a StringBuffer both of which are thread safe.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Steven Christou
            Path:
            src/main/java/com/cloudbees/jenkins/support/SupportLogFormatter.java
            http://jenkins-ci.org/commit/support-core-plugin/456542746987a33b31aadd3d0150cc34631455d8
            Log:
            Merge pull request #47 from christ66/JENKINS-30117

            JENKINS-30117 Support bundle blocks with lots of data

            Compare: https://github.com/jenkinsci/support-core-plugin/compare/2a228cedc807...456542746987

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Steven Christou Path: src/main/java/com/cloudbees/jenkins/support/SupportLogFormatter.java http://jenkins-ci.org/commit/support-core-plugin/456542746987a33b31aadd3d0150cc34631455d8 Log: Merge pull request #47 from christ66/ JENKINS-30117 JENKINS-30117 Support bundle blocks with lots of data Compare: https://github.com/jenkinsci/support-core-plugin/compare/2a228cedc807...456542746987
            Hide
            schristou Steven Christou added a comment -

            Fixed in 2.29.

            Show
            schristou Steven Christou added a comment - Fixed in 2.29.

              People

              • Assignee:
                schristou Steven Christou
                Reporter:
                schristou Steven Christou
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: