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

GhprbTrigger saves its descriptor every time it runs

XMLWordPrintable

      The GhprbTrigger saves the descriptor every time it runs:

          @Override
          public void run() {
              // triggers are always triggered on the cron, but we just no-op if we are using GitHub hooks.
              if (getUseGitHubHooks()) {
                  return;
              }
              helper.run();
              getDescriptor().save();
          }
      

      This results in the Jenkins config.xml being saved every time the trigger runs, which is especially bad if you are using the configHistory plugin.

       "jenkins.util.Timer [#2]" daemon prio=10 tid=0x00007f61a4002800 nid=0x2dad runnable [0x00007f61d1185000]
          java.lang.Thread.State: RUNNABLE
             at java.util.TimSort.sort(Unknown Source)
             at java.util.TimSort.sort(Unknown Source)
             at java.util.Arrays.sort(Unknown Source)
             at java.util.Collections.sort(Unknown Source)
             at hudson.plugins.jobConfigHistory.FileHistoryDao.hasDuplicateHistory(FileHistoryDao.java:540)
             at hudson.plugins.jobConfigHistory.FileHistoryDao.checkDuplicate(FileHistoryDao.java:560)
             at hudson.plugins.jobConfigHistory.FileHistoryDao.saveItem(FileHistoryDao.java:240)
             at hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener.onChange(JobConfigHistorySaveableListener.java:29)
             at hudson.model.listeners.SaveableListener.fireOnChange(SaveableListener.java:80)
             at hudson.model.Descriptor.save(Descriptor.java:760)
             - locked <0x000000009109dfa0> (a org.jenkinsci.plugins.ghprb.GhprbTrigger$DescriptorImpl)
             at org.jenkinsci.plugins.ghprb.GhprbTrigger.run(GhprbTrigger.java:182)
      
      

      Looking at the serializable fields in the descriptor, I don't see any reason why this would require being saved every time the trigger runs. Even if there is a good reason, that should be fixed to avoid this sort of behavior.

            janinko Honza Brázdil
            recampbell Ryan Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: