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

ClassicPluginStrategy doesn't update pre-installed plugins in hudson.war

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • core
    • None
    • Platform: All, OS: All

      Hi

      I found a bug in the ClassicPluginStrategy. When the .timestamp file is created
      the lastModifiedTime is set to the machine current time, which is then compared
      to the HPI file lastModifiedTime and if the latter is greater then the plugin is
      re-extracted and updated. However the HPI lastModificationTime of the
      pre-installed plugin(s) is set to the date when the plugin was compiled and for
      that reason the plugin is never updated (current machine time is always greated
      than the compilation time).

      The bug can be reproduced by using following steps:
      1) install and start new hudson 1.320
      2) check the plugin version of
      <HUDSON_HOME>/plugins/maven-plugin/META-INF/MANIFEST.MF
      3) stop hudson, update it to version 1.321, and start it again
      4) check the plugin version again. It is still 1.320

      I narrow down the problem inside the ClassicPluginStrategy, so instead of using
      the machine current time it is setting the .timestamp lastModifiedTime to HPI
      file lastModifiedTime.

      Best regards
      Kiril

          [JENKINS-4353] ClassicPluginStrategy doesn't update pre-installed plugins in hudson.war

          kir0 added a comment -

          Created an attachment (id=878)
          Proposed fix. It also includes functionality to force plugin extraction trough System property

          kir0 added a comment - Created an attachment (id=878) Proposed fix. It also includes functionality to force plugin extraction trough System property

          kir0 added a comment -

          I also think that https://hudson.dev.java.net/issues/show_bug.cgi?id=4283 could
          be caused by this problem

          kir0 added a comment - I also think that https://hudson.dev.java.net/issues/show_bug.cgi?id=4283 could be caused by this problem

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/UpdateCenter.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=21979
          Log:
          [FIXED JENKINS-4353] we should now be able to update bundled plugins.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/model/UpdateCenter.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=21979 Log: [FIXED JENKINS-4353] we should now be able to update bundled plugins.

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=21996
          Log:
          This is the correct fix for JENKINS-4353.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/ClassicPluginStrategy.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=21996 Log: This is the correct fix for JENKINS-4353 .

          Code changed in hudson
          User: : kohsuke
          Path:
          branches/rc/core/src/main/java/hudson/ClassicPluginStrategy.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=22237
          Log:
          JENKINS-4353 My fix had a crucial bug that prevents plugin updates from failing.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: branches/rc/core/src/main/java/hudson/ClassicPluginStrategy.java http://fisheye4.cenqua.com/changelog/hudson/?cs=22237 Log: JENKINS-4353 My fix had a crucial bug that prevents plugin updates from failing.

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=22238
          Log:
          JENKINS-4353 My fix had a crucial bug that prevents plugin updates from failing.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=22238 Log: JENKINS-4353 My fix had a crucial bug that prevents plugin updates from failing.

            Unassigned Unassigned
            kir0 kir0
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: