[JIRA] (JENKINS-56505) Performance Issue: JobDSL plugin creates folders All view with a localized name

5 views
Skip to first unread message

michael.i.ahern@gmail.com (JIRA)

unread,
Mar 11, 2019, 1:25:01 PM3/11/19
to jenkinsc...@googlegroups.com
Michael Ahern created an issue
 
Jenkins / Bug JENKINS-56505
Performance Issue: JobDSL plugin creates folders All view with a localized name
Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 2019-03-11 17:24
Priority: Major Major
Reporter: Michael Ahern

The JobDSL plugin is creating folders with the all view as all view called `All` instead of `all`. After folders are created by the JobDSL plugin, the Jenkins system will thrash and update the folder configuration to rename the element from `All` to `all` (lowercased).

Major performance issues are seen with JobDSLs configuring large numbers of views. Our system became nearly inoperable until an interim patch was applied.

Please see JENKINS-38606 for the internal details of the issue.

The fix is fairly trivial. A pull request with the fix for issue is available here:

https://github.com/jenkinsci/job-dsl-plugin/pull/1148

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mail@daniel-spilker.com (JIRA)

unread,
Mar 16, 2019, 5:59:02 AM3/16/19
to jenkinsc...@googlegroups.com
Daniel Spilker commented on Bug JENKINS-56505
 
Re: Performance Issue: JobDSL plugin creates folders All view with a localized name

Michael Ahern How can I reproduce the behavior?

I am running Jenkins 2.121.1 in the official Docker container and installed Folder plugin 6.5.1. When I create a folder, the "All" view is named "All". An restarting Jenkins does not change that.

<com.cloudbees.hudson.plugins.folder.Folder plugin="cloudbee...@6.5.1">
  <description/>
  <properties/>
  <folderViews class="com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder">
    <views>
      <hudson.model.AllView>
        <owner class="com.cloudbees.hudson.plugins.folder.Folder" reference="../../../.."/>
        <name>All</name>
        <filterExecutors>false</filterExecutors>
        <filterQueue>false</filterQueue>
        <properties class="hudson.model.View$PropertyList"/>
      </hudson.model.AllView>
    </views>
    <tabBar class="hudson.views.DefaultViewsTabBar"/>
  </folderViews>
  <healthMetrics>
    <com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric>
      <nonRecursive>false</nonRecursive>
    </com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric>
  </healthMetrics>
  <icon class="com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon"/>
</com.cloudbees.hudson.plugins.folder.Folder>

mail@daniel-spilker.com (JIRA)

unread,
Mar 16, 2019, 6:00:02 AM3/16/19
to jenkinsc...@googlegroups.com

michael.i.ahern@gmail.com (JIRA)

unread,
Apr 23, 2019, 5:13:03 AM4/23/19
to jenkinsc...@googlegroups.com
Michael Ahern commented on Bug JENKINS-56505
 
Re: Performance Issue: JobDSL plugin creates folders All view with a localized name

Daniel Spilker - so I was able to easily reproduce the issue using the LTS docker image. That is `Jenkins ver. 2.164.2` at the time of this writing.

To reproduce:

  1. docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
  2. On initial startup, install the "recommended" plugins - do not customize the list
  3. Install the JobDSL plugin
  4. Create a FreeStyle job CreateFolder
  5. Configure the free style job to have an inline DSL section and provide the snippet below:
    {
    Unknown macro: {folder('GenFolder') {   displayName('GenFolder')   description('GenFolder') }}

    }

  6. Save 
  7. Run the CreateFolder Job
  8. Navigate in the Jenkins UI to the {{GenFolder}} directory (I get an error message in the UI, but this is fine)
  9. Navigate to the Logs page: `<your-server>/log/all`
  10. You should see the following log message: JENKINS-38606 detected for AllView in com.cloudbees.hudson.plugins.folder.Folder@38aa17c8[GenFolder]; renaming view from All to all

 

This lines up with the expectations based on the Folder code:

https://github.com/jenkinsci/cloudbees-folder-plugin/blob/e9a4d5b19e7db6021f81d2c4c8c2afa328e0d9f8/src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java#L248

If you look there, the code requires that a primaryView be defined when this block of code is hit. I am not sure of the exact situation necessary, but it is fairly common in the wild. Following the code for {{ migrateLegacyPrimaryAllViewLocalizedName }}:

https://github.com/jenkinsci/cloudbees-folder-plugin/blob/e9a4d5b19e7db6021f81d2c4c8c2afa328e0d9f8/src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java#L176

Under common conditions this will attempt to rename the view to {{ AllView.DEFAULT_VIEW_NAME }}. Checking that code: 

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/AllView.java#L61

... {{ AllView.DEFAULT_VIEW_NAME }} is {{ "all" }} (in lowercase).

michael.i.ahern@gmail.com (JIRA)

unread,
Apr 23, 2019, 5:14:02 AM4/23/19
to jenkinsc...@googlegroups.com

michael.i.ahern@gmail.com (JIRA)

unread,
Apr 23, 2019, 5:14:02 AM4/23/19
to jenkinsc...@googlegroups.com
Michael Ahern edited a comment on Bug JENKINS-56505
 
Re: Performance Issue: JobDSL plugin creates folders All view with a localized name
[~daspilker] - so I was able to easily reproduce the issue using the LTS docker image. That is `[Jenkins ver. 2.164.2|https://jenkins.io/]` at the time of this writing.

To reproduce:
# {{docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts}}
# On initial startup, install the "recommended" plugins - do not customize the list
# Install the JobDSL plugin
# Create a FreeStyle job {{CreateFolder}}
# Configure the free style job to have an inline DSL section and provide the snippet below:
\{{folder('GenFolder') {   displayName('GenFolder')   description('GenFolder') }}}
# Save 
# Run the {{CreateFolder}} Job
# Navigate in the Jenkins UI to the {{{{GenFolder}}}} directory (I get an error message in the UI, but this is fine)
# Navigate to the Logs page: `[<your-server>/log/all|http://localhost:8080/log/all]`
# You should see the following log message: {{JENKINS-38606 detected for AllView in com.cloudbees.hudson.plugins.folder.Folder@38aa17c8[GenFolder]; renaming view from All to all}}


 

This lines up with the expectations based on the Folder code:

[https://github.com/jenkinsci/cloudbees-folder-plugin/blob/e9a4d5b19e7db6021f81d2c4c8c2afa328e0d9f8/src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java#L248]

If you look there, the code requires that a primaryView be defined when this block of code is hit. I am not sure of the exact situation necessary, but it is fairly common in the wild. Following the code for \{{ migrateLegacyPrimaryAllViewLocalizedName }}:

[https://github.com/jenkinsci/cloudbees-folder-plugin/blob/e9a4d5b19e7db6021f81d2c4c8c2afa328e0d9f8/src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java#L176]

Under common conditions this will attempt to rename the view to {{ AllView.DEFAULT_VIEW_NAME }}. Checking that code: 

[https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/AllView.java#L61]

... {{ AllView.DEFAULT_VIEW_NAME }} is
\ {{ "all" }} (in lowercase).

michael.i.ahern@gmail.com (JIRA)

unread,
Apr 23, 2019, 5:15:02 AM4/23/19
to jenkinsc...@googlegroups.com
Michael Ahern edited a comment on Bug JENKINS-56505
[~daspilker] - so I was able to easily reproduce the issue using the LTS docker image. That is `[Jenkins ver. 2.164.2|https://jenkins.io/]` at the time of this writing.

To reproduce:
# {{docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts}}
# On initial startup, install the "recommended" plugins - do not customize the list
# Install the JobDSL plugin
# Create a FreeStyle job {{CreateFolder}}
# Configure the free style job to have an inline DSL section and provide the snippet below:
\{{

 *
folder('GenFolder') \ {   displayName('GenFolder')   description('GenFolder') } }} *
# Save 
# Run the {{CreateFolder}} Job
# Navigate in the Jenkins UI to the {{{{GenFolder}}}} directory (I get an error message in the UI, but this is fine)
# Navigate to the Logs page: `[<your-server>/log/all|http://localhost:8080/log/all]`
# You should see the following log message: {{JENKINS-38606 detected for AllView in com.cloudbees.hudson.plugins.folder.Folder@38aa17c8[GenFolder]; renaming view from All to all}}

 

This lines up with the expectations based on the Folder code:

[https://github.com/jenkinsci/cloudbees-folder-plugin/blob/e9a4d5b19e7db6021f81d2c4c8c2afa328e0d9f8/src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java#L248]

If you look there, the code requires that a primaryView be defined when this block of code is hit. I am not sure of the exact situation necessary, but it is fairly common in the wild. Following the code for \{{ migrateLegacyPrimaryAllViewLocalizedName }}:

[https://github.com/jenkinsci/cloudbees-folder-plugin/blob/e9a4d5b19e7db6021f81d2c4c8c2afa328e0d9f8/src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java#L176]

Under common conditions this will attempt to rename the view to
\ {{ AllView.DEFAULT_VIEW_NAME }}. Checking that code: 


[https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/AllView.java#L61]

...  {{AllView.DEFAULT_VIEW_NAME}} is {{"all"}} (in lowercase).

mail@daniel-spilker.com (JIRA)

unread,
Jun 8, 2019, 9:43:02 AM6/8/19
to jenkinsc...@googlegroups.com

mail@daniel-spilker.com (JIRA)

unread,
Mar 11, 2020, 9:07:02 AM3/11/20
to jenkinsc...@googlegroups.com
Change By: Daniel Spilker
Status: Fixed but Unreleased Closed
Released As: job-dsl 1.73
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages