Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313346

Summary: [transport] download progress for artifacts bigger than 2.1 gig is off
Product: [Eclipse Project] Equinox Reporter: Helmut J. Haigermoser <helmut.haigermoser>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: minor    
Priority: P3 CC: pascal
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
screen shot showing the progress message for the 2.2 gig artifact none

Description Helmut J. Haigermoser CLA 2010-05-18 09:07:42 EDT
Build Identifier: 3.6.M7

When installing artifacts bigger than 2.1 gig (well, 2^31 bytes to be precise) the ProgressStatistics class will produce a message that says "Fetching x of -123123B", showing an integer overflow.

After some digging I found the culprit to be the UrlConnectionRetrieveFileTransfer, a class that uses the JRE-provided file transfer, a transfer that stores file size in an integer, where every other place is using long.

Not sure what to do about this, but maybe we can use a different file transfer for file: URIs, or maybe even convince sun/oracle/whoever to add a long version of the contentLength method?

From class java.netURL.Connection:

    public int getContentLength() {
	return getHeaderFieldInt("content-length", -1);
    }

Reproducible: Always

Steps to Reproduce:
1. Have an artifact bigger 2.1 gig
2. Install it from a file: URI
3. Watch the install progress
Comment 1 Helmut J. Haigermoser CLA 2010-05-18 09:09:54 EDT
Created attachment 168923 [details]
screen shot showing the progress message for the 2.2 gig artifact
Comment 2 Pascal Rapicault CLA 2010-05-18 10:23:25 EDT
>Not sure what to do about this,
  What about splitting your artifact in two :)

Do you know if the same issue is happening when using the apache http client ?
Comment 3 Helmut J. Haigermoser CLA 2010-05-18 10:53:07 EDT
(In reply to comment #2)
> What about splitting your artifact in two :)
Yes, that's an acceptable workaround, but not a fix ;)
> 
> Do you know if the same issue is happening when using the apache http client ?
I did not try but looked at the http code and there everything is about long's, no int's to be found...
Comment 4 Eclipse Genie CLA 2018-12-09 14:14:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Lars Vogel CLA 2019-09-04 01:53:27 EDT
This bug was marked as stalebug a while ago. Marking as worksforme.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.