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

Deadlock in logging

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Observed a deadlock including a thread blocked like this:

      com.cloudbees.jenkins.support.impl.JenkinsLogs$LogFile.publish
      com.cloudbees.jenkins.support.impl.JenkinsLogs$CustomHandler.publish
      java.util.logging.Logger.log
      <Redacted>QueueTaskDispatcher.canTake
      hudson.model.Queue$BuildableItem.canTake
      hudson.model.Queue$BuildableItem.getCauseOfBlockage
      hudson.model.Queue$Item.getWhy
      hudson.model.Queue$Item.toString
      java.text.MessageFormat.subformat
      java.text.MessageFormat.format
      java.text.Format.format
      java.text.MessageFormat.format
      java.util.logging.Formatter.formatMessage
      com.cloudbees.jenkins.support.SupportLogFormatter.format
      java.util.logging.StreamHandler.publish
      com.cloudbees.jenkins.support.impl.JenkinsLogs$LogFile.publish
      

      vs. another blocked like this:

      com.cloudbees.jenkins.support.SupportLogFormatter.format
      java.util.logging.StreamHandler.publish
      com.cloudbees.jenkins.support.impl.JenkinsLogs$LogFile.publish
      com.cloudbees.jenkins.support.impl.JenkinsLogs$CustomHandler.publish
      

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/com/cloudbees/jenkins/support/impl/JenkinsLogs.java
          http://jenkins-ci.org/commit/support-core-plugin/d7af2fa1ff7d8afc4b2d4b7ac247e3c02d4e7ee7
          Log:
          [FIXED JENKINS-22326] Do not reuse a SupportLogFormatter across handlers.
          Its lock could be held while calling toString on something which might in turn log something against another handler.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/com/cloudbees/jenkins/support/impl/JenkinsLogs.java http://jenkins-ci.org/commit/support-core-plugin/d7af2fa1ff7d8afc4b2d4b7ac247e3c02d4e7ee7 Log: [FIXED JENKINS-22326] Do not reuse a SupportLogFormatter across handlers. Its lock could be held while calling toString on something which might in turn log something against another handler.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/Queue.java
          http://jenkins-ci.org/commit/jenkins/a01ebae1a4783566e42d74c4edaaf1dc3ed8a43e
          Log:
          JENKINS-22326 Calling into foreign code from a toString method, like Queue.Item.getWhy → QueueTaskDispatcher, is unsafe.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Queue.java http://jenkins-ci.org/commit/jenkins/a01ebae1a4783566e42d74c4edaaf1dc3ed8a43e Log: JENKINS-22326 Calling into foreign code from a toString method, like Queue.Item.getWhy → QueueTaskDispatcher, is unsafe.
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #3250
          JENKINS-22326 Calling into foreign code from a toString method, like Queue.Item.getWhy → QueueTaskDispatcher, is unsafe. (Revision a01ebae1a4783566e42d74c4edaaf1dc3ed8a43e)

          Result = SUCCESS
          Jesse Glick : a01ebae1a4783566e42d74c4edaaf1dc3ed8a43e
          Files :

          • core/src/main/java/hudson/model/Queue.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3250 JENKINS-22326 Calling into foreign code from a toString method, like Queue.Item.getWhy → QueueTaskDispatcher, is unsafe. (Revision a01ebae1a4783566e42d74c4edaaf1dc3ed8a43e) Result = SUCCESS Jesse Glick : a01ebae1a4783566e42d74c4edaaf1dc3ed8a43e Files : core/src/main/java/hudson/model/Queue.java

            People

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

              Dates

              • Created:
                Updated:
                Resolved: