You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hervé Boutemy (JIRA)" <ji...@apache.org> on 2019/06/16 08:52:00 UTC
[jira] [Comment Edited] (WAGON-557) Integer overflow prevents
optimal buffer size selection for large artifacts
[ https://issues.apache.org/jira/browse/WAGON-557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16837588#comment-16837588 ]
Hervé Boutemy edited comment on WAGON-557 at 6/16/19 8:51 AM:
--------------------------------------------------------------
Fixed with [947fa6be3c7968f548cebb8a00995eda2a7f90c9|https://gitbox.apache.org/repos/asf?p=maven-wagon.git;a=commit;h=947fa6be3c7968f548cebb8a00995eda2a7f90c9] and tested with [baa6fc226374303e86902b82901cf8a9f71eba3a|https://gitbox.apache.org/repos/asf?p=maven-wagon.git;a=commit;h=baa6fc226374303e86902b82901cf8a9f71eba3a].
was (Author: michael-o):
Fixed with [baa6fc226374303e86902b82901cf8a9f71eba3a|https://gitbox.apache.org/repos/asf?p=maven-wagon.git;a=commit;h=baa6fc226374303e86902b82901cf8a9f71eba3a].
> Integer overflow prevents optimal buffer size selection for large artifacts
> ---------------------------------------------------------------------------
>
> Key: WAGON-557
> URL: https://issues.apache.org/jira/browse/WAGON-557
> Project: Maven Wagon
> Issue Type: Bug
> Components: wagon-provider-api
> Affects Versions: 3.3.2
> Reporter: Olaf Otto
> Assignee: Michael Osipov
> Priority: Minor
> Fix For: 3.3.3
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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:
> {code:java}
> final int numberOfBufferSegments = (int)
> numberOfBytes / ( BUFFER_SEGMENT_SIZE * MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS );
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)