Skip to content

[JENKINS-16215] Avoid unnecessary downloads in FilePath.installIfNecessaryFrom #13182

Closed

Description

@jenkins-infra-bot

FilePath.installIfNecessaryFrom is used by the DownloadFromUrlInstaller when installing things like the JDK. The current implementation issues a regular GET request just to access the 'last modified' header. This also seems to be triggered per executor resulting in lots of stress on the server hosting the JDK zip/tar.gz.

installIfNecessaryFrom could be changed to read the cached timestamp first, and issue that in the 'If-Modified-Since' header. http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setIfModifiedSince%28long%29


Originally reported by hultee, imported from: Avoid unnecessary downloads in FilePath.installIfNecessaryFrom
  • status: Resolved
  • priority: Major
  • component(s): core
  • label(s): 1.480.3-fixed, performance
  • resolution: Fixed
  • resolved: 2013-01-20T12:27:13+00:00
  • votes: 0
  • watchers: 5
  • imported: 2025-11-24
Raw content of original issue

FilePath.installIfNecessaryFrom is used by the DownloadFromUrlInstaller when installing things like the JDK. The current implementation issues a regular GET request just to access the 'last modified' header. This also seems to be triggered per executor resulting in lots of stress on the server hosting the JDK zip/tar.gz.

installIfNecessaryFrom could be changed to read the cached timestamp first, and issue that in the 'If-Modified-Since' header. http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setIfModifiedSince%28long%29

Activity

  1. jenkins-infra-bot commented on Dec 28, 2012

    @jenkins-infra-bot
    Author
    hultee:

    Fixed in #660.

  2. jenkins-infra-bot commented on Jan 20, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Lars Hvile Path: core/src/main/java/hudson/FilePath.java core/src/test/java/hudson/FilePathTest.java http://jenkins-ci.org/commit/jenkins/35f7653b7b28bb65b116f16282d9bea567405f61 Log: JENKINS-16215 Avoiding unnecessary downloads in FilePath.installIfNecessaryFrom.

      The updated version uses the locally cached timestamp, '.timestamp', to set the 'If-Modified-Since' header. 304 Not Modified responses are dealt with by aborting the installation.

    Code changed in jenkins
    User: Lars Hvile
    Path:
    core/src/main/java/hudson/FilePath.java
    core/src/test/java/hudson/FilePathTest.java
    http://jenkins-ci.org/commit/jenkins/35f7653b7b28bb65b116f16282d9bea567405f61
    Log:
    JENKINS-16215 Avoiding unnecessary downloads in FilePath.installIfNecessaryFrom.

    The updated version uses the locally cached timestamp, '.timestamp', to set the
    'If-Modified-Since' header. 304 Not Modified responses are dealt with by
    aborting the installation.

  3. jenkins-infra-bot commented on Jan 20, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Christoph Kutzinski
    Path:
    core/src/main/java/hudson/FilePath.java
    core/src/test/java/hudson/FilePathTest.java
    http://jenkins-ci.org/commit/jenkins/586af3c1ee910e99a50dde8d8b3e7aa68df06716
    Log:
    Merge pull request #660 from larshvile/master

    [FIXED JENKINS-16215] Avoiding unnecessary downloads in FilePath.installIfNecessaryFrom

    Compare: 6b1cc47...586af3c

  4. jenkins-infra-bot commented on Jan 20, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Christoph Kutzinski
    Path:
    changelog.html
    core/src/main/java/hudson/FilePath.java
    http://jenkins-ci.org/commit/jenkins/19b31687c870bba50bb181c5d08486151b1839a9
    Log:
    JENKINS-16215 : changelog

  5. jenkins-infra-bot commented on Jan 20, 2013

    @jenkins-infra-bot
    Author
    dogfood:

    Integrated in jenkins_main_trunk #2202
    JENKINS-16215 Avoiding unnecessary downloads in FilePath.installIfNecessaryFrom. (Revision 35f7653)

    Result = SUCCESS
    lars : 35f7653b7b28bb65b116f16282d9bea567405f61
    Files :

    • core/src/main/java/hudson/FilePath.java
    • core/src/test/java/hudson/FilePathTest.java
  6. jenkins-infra-bot commented on Jan 20, 2013

    @jenkins-infra-bot
    Author
    dogfood:

    Integrated in jenkins_main_trunk #2203
    JENKINS-16215 : changelog (Revision 19b3168)

    Result = UNSTABLE
    Christoph Kutzinski : 19b31687c870bba50bb181c5d08486151b1839a9
    Files :

    • core/src/main/java/hudson/FilePath.java
    • changelog.html
  7. jenkins-infra-bot commented on Jan 26, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Lars Hvile Path: core/src/main/java/hudson/FilePath.java core/src/test/java/hudson/FilePathTest.java http://jenkins-ci.org/commit/jenkins/cae2f4d4a2f6d9c8c13cf50c46baeb63f45c4501 Log: JENKINS-16215 Avoiding unnecessary downloads in FilePath.installIfNecessaryFrom.

      The updated version uses the locally cached timestamp, '.timestamp', to set the 'If-Modified-Since' header. 304 Not Modified responses are dealt with by aborting the installation. (cherry picked from commit 35f7653b7b28bb65b116f16282d9bea567405f61)

      Conflicts: core/src/test/java/hudson/FilePathTest.java

    Code changed in jenkins
    User: Lars Hvile
    Path:
    core/src/main/java/hudson/FilePath.java
    core/src/test/java/hudson/FilePathTest.java
    http://jenkins-ci.org/commit/jenkins/cae2f4d4a2f6d9c8c13cf50c46baeb63f45c4501
    Log:
    JENKINS-16215 Avoiding unnecessary downloads in FilePath.installIfNecessaryFrom.

    The updated version uses the locally cached timestamp, '.timestamp', to set the
    'If-Modified-Since' header. 304 Not Modified responses are dealt with by
    aborting the installation.
    (cherry picked from commit 35f7653)

    Conflicts:
    core/src/test/java/hudson/FilePathTest.java

  8. jenkins-infra-bot commented on Jan 26, 2013

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Christoph Kutzinski
    Path:
    changelog.html
    core/src/main/java/hudson/FilePath.java
    http://jenkins-ci.org/commit/jenkins/15c37393910da8a76c8e2224486e9a0b2cf7528f
    Log:
    JENKINS-16215 : changelog(cherry picked from commit 19b3168)

    Conflicts:
    changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions