[JIRA] (JENKINS-58993) Jenkins allows Jenkins.save() to be called during startup

6 views
Skip to first unread message

jnord@cloudbees.com (JIRA)

unread,
Aug 19, 2019, 8:03:02 AM8/19/19
to jenkinsc...@googlegroups.com
James Nord created an issue
 
Jenkins / Bug JENKINS-58993
Jenkins allows Jenkins.save() to be called during startup
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2019-08-19 12:02
Labels: dataloss
Priority: Critical Critical
Reporter: James Nord

if a miss behaving plugin calls Jenkins.save() during startup then Jenkins will honer this and save the config file.

But as Extensions may not yet be loaded and the memory model fully built this will cause loss of data as the partially populated memory model will be written without any diagnosis as to why.

 

If you enable FINE level logging on Jenkins you can see logs such as

jenkins.model.Jenkins#save: refusing to set version 2.176.2 to 2.176.2 during Loaded all jobs
jenkins.model.Jenkins#save: refusing to set version 1.0 to 2.176.2 during Augmented all extensions 

However the data is written (just without the Jenkins version) and there is no call stack to identify the caller (and worse the log is at FINE level even if plugins have not been loaded.)

Plugins should not be manipulating Jenkins during startup (at until EXTENSIONS_AUGMENTED has been reached).  
If something attempts to do this there MUST be a big fat warning in the Jenkins logs at the minimum along with a call stack to identify the caller.  
The save should probably be silently vetoed (possibly Jenkins should terminate as at this point the memory model is likely to be inconsistent with what it should be and terminating is the only way to prevent data loss as the next save after this would cause the inconsistent memory model to be written to disk).  

 

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

jnord@cloudbees.com (JIRA)

unread,
Aug 24, 2019, 8:00:01 AM8/24/19
to jenkinsc...@googlegroups.com
James Nord started work on Bug JENKINS-58993
 
Change By: James Nord
Status: Open In Progress

jnord@cloudbees.com (JIRA)

unread,
Aug 24, 2019, 8:00:02 AM8/24/19
to jenkinsc...@googlegroups.com

jnord@cloudbees.com (JIRA)

unread,
Oct 4, 2019, 6:59:02 AM10/4/19
to jenkinsc...@googlegroups.com
James Nord closed an issue as Fixed
Change By: James Nord
Status: In Progress Closed
Resolution: Fixed
Released As: jenkins-2.199
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages