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

Hot loaded plugin which extend HealthCheckProvider will fail to work property

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If you hot load a plugin from the update center and this plugin has an extension point to HealthCheckProvider, the provided won't be loaded correctly and it will print this exception on the log:

      May 22, 2017 10:42:28 AM jenkins.metrics.api.Metrics$HealthChecker$3 run
      SEVERE: Error running jenkins.metrics.api.Metrics$HealthChecker
      java.lang.UnsupportedOperationException
      	at java.util.Collections$UnmodifiableCollection.add(Collections.java:1055)
      	at jenkins.metrics.api.Metrics$HealthChecker.execute(Metrics.java:604)
      	at jenkins.metrics.api.Metrics$HealthChecker.access$700(Metrics.java:408)
      	at jenkins.metrics.api.Metrics$HealthChecker$3.run(Metrics.java:554)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      This is because in case the provider is not registered, the metrics plugin will try to register it by modifiying an unmodifiableSortedSet:

      https://github.com/jenkinsci/metrics-plugin/blob/d94a4547b11263c094b2f713b37f7f0610882878/src/main/java/jenkins/metrics/api/Metrics.java#L604

      https://github.com/iZettle/dropwizard-metrics/blob/v3.1.2/metrics-healthchecks/src/main/java/com/codahale/metrics/health/HealthCheckRegistry.java#L51

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/metrics/api/Metrics.java
            http://jenkins-ci.org/commit/metrics-plugin/8cbd81e88b1ce6667b67be0e81d333f5a161d5fd
            Log:
            Merge pull request #29 from dwnusbaum/JENKINS-44486

            JENKINS-44486 Prevent UnsupportedOperationException when installing plugins with custom health checks.

            Compare: https://github.com/jenkinsci/metrics-plugin/compare/987c6db35cf2...8cbd81e88b1c

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/metrics/api/Metrics.java http://jenkins-ci.org/commit/metrics-plugin/8cbd81e88b1ce6667b67be0e81d333f5a161d5fd Log: Merge pull request #29 from dwnusbaum/ JENKINS-44486 JENKINS-44486 Prevent UnsupportedOperationException when installing plugins with custom health checks. Compare: https://github.com/jenkinsci/metrics-plugin/compare/987c6db35cf2...8cbd81e88b1c
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Fixed in metrics:3.1.2.11.

            Show
            dnusbaum Devin Nusbaum added a comment - Fixed in metrics:3.1.2.11 .

              People

              • Assignee:
                dnusbaum Devin Nusbaum
                Reporter:
                alobato Alvaro Lobato
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: