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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Platform: All, OS: All

      Description

      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

        Activity

        kir0 kir0 created issue -
        Hide
        kir0 kir0 added a comment -

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

        Show
        kir0 kir0 added a comment - Created an attachment (id=878) Proposed fix. It also includes functionality to force plugin extraction trough System property
        Hide
        kir0 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

        Show
        kir0 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
        Hide
        scm_issue_link 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.

        Show
        scm_issue_link 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.
        scm_issue_link SCM/JIRA link daemon made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        scm_issue_link 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.

        Show
        scm_issue_link 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 .
        Hide
        scm_issue_link 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.

        Show
        scm_issue_link 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.
        Hide
        scm_issue_link 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.

        Show
        scm_issue_link 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.
        abayer abayer made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: