Bug 18585 - Search stops if fail to contact site
Summary: Search stops if fail to contact site
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.0.1   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 22190 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-01 09:10 EDT by Christophe Elek CLA
Modified: 2002-08-09 16:32 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Elek CLA 2002-06-01 09:10:29 EDT
0531

add bookmark to 
http://klicnik/eclipseFixes/
Alphabet Soup Site
Search for my.alphabet_1.0.0
You should be prompted for userid/paswd for the EclipseFixes site
Click cancel
The error dialog opens. the search stops

Maybe we should continue ? what if one of the bookmark site is down ?
Comment 1 Christophe Elek CLA 2002-08-07 14:09:24 EDT
*** Bug 22190 has been marked as a duplicate of this bug. ***
Comment 2 Tim Koss CLA 2002-08-07 14:55:40 EDT
do you know when you will have a version of this for us to test. We are entering
a test pass at the end of the week and need the update to work
Comment 3 Dejan Glozic CLA 2002-08-07 19:36:14 EDT
The general problem here is that all the problems that can happen as when 
asking for a site using the URL are lumped together and reported by throwing a 
CoreException. This way, the UI cannot tell if the problem is an internal error 
(that should correctly stop the search) or a legal URL issue that should not 
cause the operation to terminate prematurely.

A possible fix for this would be:

1) Update Core identifies cases where connection fails and throws 
ConnectionFailedException or similar. This exception is a subclass of 
CoreException.

2) Update UI catches ConnectionFailedException and silently continues the 
search but allows CoreExceptions to pass through, causing the search to 
continue.

Since 1) requires API modification that we would not like to do in 2.0.1,
a simpler alternative is for Core to set the result code to a well know
value, indicating UI what is the problem. For example, set it to 42 
for connection problems:

try {
    // try to get the site given the URL
catch (CoreException e) {
    if (e.getStatus().getCode()!=42)
       throw e;
}

This way, connection-related exception will 'fall through' and real problems 
will cause search to terminate with an error message.
Comment 4 Dejan Glozic CLA 2002-08-07 19:49:07 EDT
Christophe, if even setting the result code is too much trouble, take a look at 
the following line:

	ISite site = SiteManager.getSite(siteURL);

This is line 290 in 'SearchObject.java' in Update UI. If anything goes wrong 
with this call, Update Core will throw CoreException that will cause search to 
stop. If this call is enclosed in a try/catch block and we silently ignore the 
failure and move on to the next search task, will we make a mistake by ignoring 
possibly fatal exceptions?
Comment 5 Christophe Elek CLA 2002-08-08 06:44:06 EDT
Answer Yes as it is the entry point ot obtain a Site
Setting a known Value seems possible.
Comment 6 Christophe Elek CLA 2002-08-08 13:54:46 EDT
Added code in 2.0.1 stream
Comment 7 Dejan Glozic CLA 2002-08-08 20:50:30 EDT
Added Update UI code in 2.0.1 stream
Comment 8 Christophe Elek CLA 2002-08-09 07:35:57 EDT
tested in 2.0.1, Fixed minor bug when returning multiple status.
Released code in 2.0.1 Stream. version r201_v20020809H0700

can we get a trace result of each search so we know what happened for each site like

Start searching at <time>
Searching... site1. found 2 new features
Searhcing... site2. Failed to access site
Searching... site3. No new features found
Finished searching. at <time>
Comment 9 Dejan Glozic CLA 2002-08-09 10:23:25 EDT
Are you proposing to support tracing and introduce tracing options that can 
control trace printing of the search progress for the debugging purposes?
Comment 10 Christophe Elek CLA 2002-08-09 10:56:50 EDT
I propose a UI trace so the user knows what happened during a UI search. This
not a debug trace.
Look at Symantec Live Update, it logs what server it connected to, if it was
sucessfull or not and what it found.
As a user it will help me realize if teh server was down and I should retry
later or if no update were found
Comment 11 Dejan Glozic CLA 2002-08-09 11:36:43 EDT
A trace would not be in Eclipse spirit (we use console for output, log files 
for errors etc.). But I can see the value of informing the user of abnormal 
events.

What we can do is collect these events during the search and present them to 
the user in a message dialog at the end. Something like:

There were connection failures during the search.

If you press the 'Details' button, you can see the list of failures, including 
status messages etc. You still get your trace, but it is displayed using
Eclipse standard practice for problem details.
Comment 12 Dejan Glozic CLA 2002-08-09 16:32:49 EDT
Implemented. Status objects that are collected when connection problem 
exceptions are thrown are kept in a list until the end of the search. At that 
point, a multi-status object is created and a new core exception is thrown. 
This causes the error message to show up with the text:

Network connection problems encountered during the search.

Pressing on the 'Details' button shows the exact problems.