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

Artifacts with a file size exceeding 2GB are served with negative file size

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Hudson 1.355

      When downloading build artifacts from Hudson, files with a size exceeding 2 GB are served with a negative file size in the HTTP header.

      This blocks picky HTTP clients from downloading artifacts from Hudson. More forgiving HTTP clients will download the file, but cannnot show any meaningful progress information, because they do not know the total file size in advance.

      Cause:
      The class hudson.model.DirectoryBrowserSupport.ContentInfo stores the content length in an int field. The real file size is casted from a long value to int - which limits the file size to some 2 GB (2^31-1 bytes to be exact).

      Proposed Solution:
      1.) Change field hudson.model.DirectoryBrowserSupport.ContentInfo.contentLength from int to long.
      2.) Change method signature of StaplerResponse.serveFile(...) to use long instead of int as length parameter. Note: This requires a change in the Stapler project.

          [JENKINS-6351] Artifacts with a file size exceeding 2GB are served with negative file size

          Simon Wiest created issue -
          Simon Wiest made changes -
          Description Original: When downloading build artifacts from Hudson, files with a size exceeding 2 GB are served with a negative file size in the HTTP header.

          This blocks picky HTTP clients from downloading artifacts from Hudson. More forgiving HTTP clients will download the file, but cannnot show any meaningful progress information, because they do not know the total file size in advance.

          Cause:
          The class {{hudson.model.DirectoryBrowserSupport.ContentInfo}} stores the content length in an {{int}} field. The real file size is casted from a {{long}} value to {{int}} - which limits the file size to some 2 GB (2^31-1 bytes to be exact).

          Proposed Solution:
          1.) Change field {{hudson.model.DirectoryBrowserSupport.ContentInfo.contentLength}} from int to {{long}}.
          2.) Change method signature of {{StaplerResponse.serverFile(...)}} to use {{long}} instead of {{int}} as length parameter. Note: This requires a change in the Stapler project.
          New: When downloading build artifacts from Hudson, files with a size exceeding 2 GB are served with a negative file size in the HTTP header.

          This blocks picky HTTP clients from downloading artifacts from Hudson. More forgiving HTTP clients will download the file, but cannnot show any meaningful progress information, because they do not know the total file size in advance.

          Cause:
          The class {{hudson.model.DirectoryBrowserSupport.ContentInfo}} stores the content length in an {{int}} field. The real file size is casted from a {{long}} value to {{int}} - which limits the file size to some 2 GB (2^31-1 bytes to be exact).

          Proposed Solution:
          1.) Change field {{hudson.model.DirectoryBrowserSupport.ContentInfo.contentLength}} from int to {{long}}.
          2.) Change method signature of {{StaplerResponse.serveFile(...)}} to use {{long}} instead of {{int}} as length parameter. Note: This requires a change in the Stapler project.
          Alan Harder made changes -
          Assignee New: Alan Harder [ mindless ]
          Alan Harder made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Alan Harder made changes -
          Status Original: Resolved [ 5 ] New: Verified [ 10000 ]
          Andrew Bayer made changes -
          Status Original: Verified [ 10000 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 136446 ] New: JNJira + In-Review [ 204042 ]

            mindless Alan Harder
            swiest Simon Wiest
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: