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

Bug 107211

Summary: Software Update makes same request multiple times to update server
Product: [Eclipse Project] Platform Reporter: Eric Herget <eherget>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Platform-Update-Inbox <platform-update-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: eherget, francois, pombredanne, shelleyy
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Eric Herget CLA 2005-08-17 10:13:01 EDT
I've built an RCP application with the ability pull software updates from an
eclipse update site.  When the update runs, it makes a GET request to the update
server at least twice for every file needed for update.  Here's the apache
access log for a single invocation of UpdateManagerUI.openInstaller(...)


xx.xx.xx.xx - - [17/Aug/2005:09:39:08 -0400] "GET /site.xml HTTP/1.1" 200 800

xx.xx.xx.xx - - [17/Aug/2005:09:39:08 -0400] "GET
/features/com.mycompany.myapp_1.0.1.jar HTTP/1.1" 200 31572

xx.xx.xx.xx - - [17/Aug/2005:09:39:08 -0400] "GET
/features/com.mycompany.myapp_1.0.2.jar HTTP/1.1" 200 38501

xx.xx.xx.xx - - [17/Aug/2005:09:39:08 -0400] "GET /site.xml HTTP/1.1" 200 800

xx.xx.xx.xx - - [17/Aug/2005:09:39:08 -0400] "GET /site.xml HTTP/1.1" 200 800

xx.xx.xx.xx - - [17/Aug/2005:09:39:09 -0400] "GET /site.xml HTTP/1.1" 200 800

xx.xx.xx.xx - - [17/Aug/2005:09:39:09 -0400] "GET /site.xml HTTP/1.1" 200 800

xx.xx.xx.xx - - [17/Aug/2005:09:39:09 -0400] "GET /site.xml HTTP/1.1" 200 800

xx.xx.xx.xx - - [17/Aug/2005:09:39:55 -0400] "GET
/plugins/com.thirdparty.nativelibsplugin_1.0.2.jar HTTP/1.1" 200 886687

xx.xx.xx.xx - - [17/Aug/2005:09:39:55 -0400] "GET
/features/com.mycompany.myapp_1.0.2.jar HTTP/1.1" 200 38501

xx.xx.xx.xx - - [17/Aug/2005:09:39:55 -0400] "GET
/plugins/com.mycompany.myapp_1.0.2.jar HTTP/1.1" 200 1530999

xx.xx.xx.xx - - [17/Aug/2005:09:40:02 -0400] "GET
/plugins/com.thirdparty.nativelibsplugin_1.0.2.jar HTTP/1.1" 200 886687

xx.xx.xx.xx - - [17/Aug/2005:09:40:02 -0400] "GET
/plugins/com.mycompany.myapp_1.0.2.jar HTTP/1.1" 200 1530999

xx.xx.xx.xx - - [17/Aug/2005:09:39:55 -0400] "GET
/features/com.mycompany.myapp_1.0.2.jar HTTP/1.1" 200 38501

xx.xx.xx.xx - - [17/Aug/2005:09:40:02 -0400] "GET
/plugins/com.thirdparty.nativelibsplugin_1.0.2.jar HTTP/1.1" 200 886687

xx.xx.xx.xx - - [17/Aug/2005:09:40:02 -0400] "GET
/plugins/com.mycompany.myapp_1.0.2.jar HTTP/1.1" 200 1530999


The site.xml is pulled 6 times, the others are pulled 2 or 3 times.  And this is
with the UpdateJob constructed with the download boolean argument set to false.
 If I set it to true, the feature jar files are each pulled one extra time. 
NOTE: I've changed the IP address in the log to 'xx.xx.xx.xx'.

I'm running the update programatically from an Action class with this code in
the Action.run() method:

final Shell myShell =
MyAppPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();



UpdateJob updateJob = new UpdateJob("My App Update Job", true, false);

try {

   // Use of plugin_customization.ini to set location of update policy

   // as described in documentation does not appear to work, so

   // set the update policy url here.

   updateJob.getSearchRequest().getScope().setUpdateMapURL(new
URL("http://xx.xx.xx.xx/update.policy"));

   UpdateManagerUI.openInstaller(myShell, updateJob);

} catch (MalformedURLException e) {

   MessageDialog.openError(myShell, "Unable to update software", "Malformed
update policy url");

}


Again, I've changed my IP address to 'xx.xx.xx.xx'.

The update URL defined in my feature.xml is set to an unresolvable hostname to
make sure update wasn't hitting multiple sites looking for updates.

Also (possible second issue), the documentation talks about putting an entry in
plugin_customization.ini to set the update policy URL.  I was unable to get this
to work at all.
Comment 1 Branko Tripkovic CLA 2006-06-22 19:34:30 EDT

*** This bug has been marked as a duplicate of 144876 ***