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

Jenkins allows Jenkins.save() to be called during startup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • core
    • jenkins-2.199

    Description

      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).  

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              teilo James Nord
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: