Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-557

Integer overflow prevents optimal buffer size selection for large artifacts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.2
    • 3.3.3
    • wagon-provider-api
    • None

    Description

      The change introduced for WAGON-537 was slightly modified from the original PR (see https://github.com/apache/maven-wagon/pull/51/commits/e4d34eb86906317536f2adfde4f70f3f45cb34c4) and introduced a wrap around in getBufferCapacityForTransfer:

      final int numberOfBufferSegments = (int)
                  numberOfBytes / ( BUFFER_SEGMENT_SIZE * MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS );
      

      Here, the integer cast is applied prior to the division, resulting in negative numbers forĀ  artifact sizes > 2 GB. This means the buffer capacity falls back to the default buffer size (4k) for such artifacts. While the overall performance is still better than prior to WAGON-537, this significantly reduces potential transfer speed for such large artifacts.

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              o.otto Olaf Otto
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m