Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
Jenkins 1.625.2
Description
UsageStatistics#getStatData may get called while Jenkins is not completely initialized. As it navigates all top level items, it may cause unexpected effects in extensions and plugins affecting those items.
Example stack trace:
[.....] at jenkins.model.Jenkins.getAllItems(Jenkins.java:1409) at hudson.model.UsageStatistics.getStatData(UsageStatistics.java:160) [.....] at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314) [.....] at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95) at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) [.....] at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53) at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:55) at hudson.util.HudsonIsLoading.doDynamic(HudsonIsLoading.java:45)
Attachments
Issue Links
- links to
Code changed in jenkins
User: Kohsuke Kawaguchi
Path:
core/src/main/java/hudson/model/UsageStatistics.java
http://jenkins-ci.org/commit/jenkins/3a44687df5f979ea57a3206b83817c5be7299eb3
Log:
Revert "
JENKINS-32190Make UsageStatistics#isDue check Jenkins init level before generating stats."This reverts commit d8a13ac07c4357eb74ab45a03955c0db430e3aa9.
I noticed a strange drop in usage statistics from the mid Jan 2016,
which corresponds to the time this change was released in the wild,
and further drop when LTS 1.642.2 is released with this change at
the end of Feb.
I spent some time trying to determine how this might cause instances
to stop sending data, but I couldn't come up with any. I left those
notes in
JENKINS-32190. There was some strange behaviours, but noneexplains what this is.
So I'd like to back out this change and see if that makes any impact
on the stats collection. If it backs up, then we know empirically
this change is to blame, so that would justify spending further
effort or come up with a fix from a different angle.
(cherry picked from commit b2013edbf7a4d40df2bc05a1e219d8599e642961)