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

Job configuration submission should be a bulk change

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When I submit an empty Freestyle job config in the default configuration of Jenkins 2.35, the data is being saved to the disk 8 times. All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246

      • setDisplayName
      • Project#getBuildWrappersList().rebuild (onModified handler)
      • Project#getBuilderList().rebuild (onModified handler)
      • Project#getPublisherList().rebuild (onModified handler)
      • AbstractProject#makeDisabled
      • AbstractProject#setScm
      • AbstractProject#triggers.replaceBy
      • final save()

      I think there is not so much sense to submit partial configurations to the disk due to the risk of data inconsistency there. I propose to wrap the selected code segment into a bulk operation

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/Job.java
            http://jenkins-ci.org/commit/jenkins/a0262d2fec648fe98e83a08f1735394a9f243f4d
            Log:
            JENKINS-40435 - Use BulkChange when processing config changes in Job#doConfigSubmit. (#2664)

            When an empty Freestyle job config gets submitted in the default configuration of Jenkins 2.35, the data is being saved to the disk 8 times. All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246

            • setDisplayName
            • Project#getBuildWrappersList().rebuild (onModified handler)
            • Project#getBuilderList().rebuild (onModified handler)
            • Project#getPublisherList().rebuild (onModified handler)
            • AbstractProject#makeDisabled
            • AbstractProject#setScm
            • AbstractProject#triggers.replaceBy
            • final save()

            There is not so much sense to save partial configurations to the disk due to the risk of data inconsistency there. This change just wraps the config submission section of the job into the BulkChange clause.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Job.java http://jenkins-ci.org/commit/jenkins/a0262d2fec648fe98e83a08f1735394a9f243f4d Log: JENKINS-40435 - Use BulkChange when processing config changes in Job#doConfigSubmit. (#2664) When an empty Freestyle job config gets submitted in the default configuration of Jenkins 2.35, the data is being saved to the disk 8 times . All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246 setDisplayName Project#getBuildWrappersList().rebuild (onModified handler) Project#getBuilderList().rebuild (onModified handler) Project#getPublisherList().rebuild (onModified handler) AbstractProject#makeDisabled AbstractProject#setScm AbstractProject#triggers.replaceBy final save() There is not so much sense to save partial configurations to the disk due to the risk of data inconsistency there. This change just wraps the config submission section of the job into the BulkChange clause.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Released in jenkins-2.37, marking as LTS candidate

            Show
            oleg_nenashev Oleg Nenashev added a comment - Released in jenkins-2.37, marking as LTS candidate
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/Job.java
            http://jenkins-ci.org/commit/jenkins/ea97d511948ad4f3ae0a972d693aabab4a993ec1
            Log:
            JENKINS-40435 - Use BulkChange when processing config changes in Job#doConfigSubmit. (#2664)

            When an empty Freestyle job config gets submitted in the default configuration of Jenkins 2.35, the data is being saved to the disk 8 times. All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246

            • setDisplayName
            • Project#getBuildWrappersList().rebuild (onModified handler)
            • Project#getBuilderList().rebuild (onModified handler)
            • Project#getPublisherList().rebuild (onModified handler)
            • AbstractProject#makeDisabled
            • AbstractProject#setScm
            • AbstractProject#triggers.replaceBy
            • final save()

            There is not so much sense to save partial configurations to the disk due to the risk of data inconsistency there. This change just wraps the config submission section of the job into the BulkChange clause.
            (cherry picked from commit a0262d2fec648fe98e83a08f1735394a9f243f4d)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Job.java http://jenkins-ci.org/commit/jenkins/ea97d511948ad4f3ae0a972d693aabab4a993ec1 Log: JENKINS-40435 - Use BulkChange when processing config changes in Job#doConfigSubmit. (#2664) When an empty Freestyle job config gets submitted in the default configuration of Jenkins 2.35, the data is being saved to the disk 8 times . All of them happen in this code: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Job.java#L1227-L1246 setDisplayName Project#getBuildWrappersList().rebuild (onModified handler) Project#getBuilderList().rebuild (onModified handler) Project#getPublisherList().rebuild (onModified handler) AbstractProject#makeDisabled AbstractProject#setScm AbstractProject#triggers.replaceBy final save() There is not so much sense to save partial configurations to the disk due to the risk of data inconsistency there. This change just wraps the config submission section of the job into the BulkChange clause. (cherry picked from commit a0262d2fec648fe98e83a08f1735394a9f243f4d)
            Hide
            drekbour Marc Carter added a comment -

            Oleg Nenashev what is the best way to determine if current Jenkins contains this change. I'm not sure how to use VersionNumber to check both the LTS 2.32.2 and master 2.37 versions

            Show
            drekbour Marc Carter added a comment - Oleg Nenashev what is the best way to determine if current Jenkins contains this change. I'm not sure how to use VersionNumber to check both the LTS 2.32.2 and master 2.37 versions

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                oleg_nenashev Oleg Nenashev
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: