Skip to content
Commit ea97d511 authored by Oleg Nenashev's avatar Oleg Nenashev Committed by Oliver Gondža
Browse files

[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 a0262d2f)
parent ce8edf0d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment