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

Bug 236157

Summary: Failed download of flat bundles or features is not retried
Product: [Eclipse Project] Equinox Reporter: Pascal Rapicault <pascal>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jeffmcaffer, john.arthorne, kim.moir, philippe_mulet, simon_kaegi, tjwatson
Version: 3.4Flags: pascal: review? (tjwatson)
jeffmcaffer: review+
john.arthorne: review+
pascal: review? (Mike_Wilson)
pascal: review? (dj.houghton)
Target Milestone: 3.4 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch ensuring that retry errors are not being consumed
none
Patch to close stream created when the source is a folder
none
Patch to the generator none

Description Pascal Rapicault CLA 2008-06-06 20:52:23 EDT
While testing the fix for bug #233214, I discovered that errors in the download of bundles that ends up being unzipped on disk (or features) would not be retried on the mirrors, thus most of the time causing the installation to fail.
Comment 1 Pascal Rapicault CLA 2008-06-06 23:13:38 EDT
Created attachment 104067 [details]
Patch ensuring that retry errors are not being consumed

The patch consists in checking if the result of the download is a retry operation, and even in case of other failures propagate the retry error code.
The patch is safe since it consists in adding more checks.
Comment 2 Pascal Rapicault CLA 2008-06-06 23:31:31 EDT
Created attachment 104071 [details]
Patch to close stream created when the source is a folder

This patch fixes another problem that I encountered when trying to reproduce this one. The core problem is that when we are downloading bundles from a repo where the artifact is stored as jar (e.g. add an eclipse install as a repo), the processing steps are not being closed.
This patch simply calls the "reportStatus" method that causes the processing steps to be closed.
Comment 3 Pascal Rapicault CLA 2008-06-06 23:44:06 EDT
Created attachment 104072 [details]
Patch to the generator

Now here is a patch for the generator since when doing this work we noticed that we missed adding the download content type to the artifact that are representing features. I think that given what happens to feature we could probably leave without it, though I think it is safer to put it in.
Comment 4 Pascal Rapicault CLA 2008-06-06 23:45:18 EDT
(Marking for RC4 because we don't have any other milestone)
Comment 5 Jeff McAffer CLA 2008-06-07 15:24:25 EDT
looks good.  I do wonder if we should be returning  retry code (if there are more mirrors) in the first part of downloadArtifact (from the second patch) but that should only happen in cases where the repo is local.  in that case it is not clear that we have mirrors so...
Comment 6 John Arthorne CLA 2008-06-08 00:36:56 EDT
Can you explain more why these fixes are important for 3.4.0? How likely are these failures? Patch #2 seems unrelated to the first problem, and looks like code that has been this way for quite awhile.
Comment 7 John Arthorne CLA 2008-06-09 02:39:00 EDT
I understand now that the first two patches are fixing problems in our fix for bug 233214 on Friday. That fix introduced the regression of not closing the stream that patch #2 is addressing. Our testing of the fix didn't catch this because we were testing from within the IDE, but the build takes a different code path that is now failing because of this regression (bug 236173). I think we must either fix this, or revert the fix in bug 233214 that caused the regression.  I have tested the code path that produces the logged errors described in bug 236173 comment 0, and verified that Pascal's patch fixes it.

I'm not as convinced of the urgency of patch #3. My worry is that this will exercise different code paths that we have not had time to properly test. The consequence of a corrupt feature jar is also not as severe (patch #3 adds a processing step that verifies the downloaded artifact is a zip file).

One issue with patch #1: the old code had a return statement inside a finally block. This is of course a bad coding pattern because it causes arbitrary runtime exceptions and errors from the try block to be discarded. The patch removes the return statement from the finally block. Normally I would say this is a good change, but being paranoid at this point I worry that it could cause exceptions to surface that were previously consumed by the return statement in the finally block. I would opt to leave the return statement inside the finally block at this point in the interest of minimizing changes, and enter a bug to fix it up further post 3.4.
Comment 8 Philipe Mulet CLA 2008-06-10 11:58:57 EDT
RC4 is behind us, please update the target appropriately
Comment 9 Pascal Rapicault CLA 2008-06-10 12:11:16 EDT
Actually the two first patches made it into RC4. The one left can wait and could be evaluated for 3.4.1.
Comment 10 Pascal Rapicault CLA 2008-06-11 10:31:52 EDT
*** Bug 236173 has been marked as a duplicate of this bug. ***
Comment 11 John Arthorne CLA 2008-06-11 10:38:29 EDT
I'm going to mark this fixed because we did release a fix for the issue in the title in 3.4 RC4 (and we have a blocking 3.4 defect marked as a duplicate). I have entered bug 236644 for the remaining issue which is not really related to the problem described here.