Issue Type: Bug Bug
Assignee: stephenconnolly
Components: cloudbees-folder
Created: 09/Oct/14 2:51 PM
Description:

Folder.getBuildHealthReports looks like it is double-counting each child Folder. It does a recursive traversal of the folder, applying FolderHealthMetric.Reporter to each node (leaf or not). But a typical FolderHealthMetric like WorstChildHealthMetric also calls getHealthReport on the child Folder, which winds up calling Folder.getBuildHealthReports recursively! This seems like a mistake.

Possible fixes:

  • Make WorstChildHealthMetric.ReporterImpl.observe (and any other similar impls) ignore a Folder it is given.
  • Make Folder.getBuildHealthReports not ask a reporter to observe a Folder.
  • Make Folder.getBuildHealthReports not do a recursive traversal, only asking about direct children.

My preference is for the third fix, as it leaves the reporter in control of the logic; if it needs a recursive call it can do one.

By the way, the awkward reflection code in getHealthReport suggests that we need an interface in Jenkins core, such as

interface ItemWithHealthReport extends Item {
    HealthReport getBuildHealth();
    List<HealthReport> getBuildHealthReports();
}
Project: Jenkins
Labels: performance health
Priority: Major Major
Reporter: Jesse Glick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to