Bug 99059 - [Connection] Network connection problems being written to the Eclipse log
Summary: [Connection] Network connection problems being written to the Eclipse log
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P5 minor (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-06-08 16:36 EDT by Stefan Xenos CLA
Modified: 2007-12-12 08:35 EST (History)
4 users (show)

See Also:
Szymon.Brandys: review+


Attachments
Patch (1.31 KB, patch)
2007-11-27 08:25 EST, Tomasz Zarna CLA
no flags Details | Diff
My proposal (1.41 KB, patch)
2007-11-28 10:10 EST, Szymon Brandys CLA
no flags Details | Diff
Patch #3 (2.88 KB, patch)
2007-12-03 08:39 EST, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2005-06-08 16:36:24 EDT
N20050608-0010

Found this in my log. This seems to be a normal network connection problem, not
a bug in Eclipse. It should not be written to the log.

Could not connect to :aoeuaoeu:saoeuu@aoeuaoeu:/home/aouaoeu: I/O exception
occurred: Connection refused: /home/aouaoeu: no such repository

java.io.IOException: Connection refused: /home/aouaoeu: no such repository
at
org.eclipse.team.internal.ccvs.core.connection.PServerConnection.authenticate(PServerConnection.java:196)
at
org.eclipse.team.internal.ccvs.core.connection.PServerConnection.open(PServerConnection.java:108)
at
org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:128)
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:494)
at
org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:735)
at org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:149)
at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher.performUpdate(RemoteFolderMemberFetcher.java:95)
at
org.eclipse.team.internal.ccvs.ui.operations.FetchMembersOperation$InternalRemoteFolderMemberFetcher.performUpdate(FetchMembersOperation.java:69)
at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher.fetchMembers(RemoteFolderMemberFetcher.java:62)
at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher.fetchMembers(RemoteFolderMemberFetcher.java:53)
at
org.eclipse.team.internal.ccvs.ui.operations.FetchMembersOperation.execute(FetchMembersOperation.java:107)
at
org.eclipse.team.internal.ccvs.ui.operations.CVSOperation.run(CVSOperation.java:79)
at
org.eclipse.team.internal.ccvs.ui.model.CVSTagElement.fetchDeferredChildren(CVSTagElement.java:134)
at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Comment 1 Michael Valenta CLA 2005-06-08 16:50:07 EDT
The error is logged by the Jobs framework. If you feel strongly about this, 
you can reopen it and assign it the Platform Runtime.
Comment 2 Stefan Xenos CLA 2005-06-08 19:23:41 EDT
It appears that the exception is logged by CVSPlugin.openError. CVSModelElement
passes all exceptions to this method, causing everything to be logged (bug or
not). These appear to be CVS classes, not core classes... but cc'ing the
talented Mr. Arthorne to confirm.
Comment 3 John Arthorne CLA 2005-06-09 17:54:37 EDT
I'll take Stefan's word for it.  Since it's a checked exception being logged, I
don't think it could be the jobs framework logging it anyway.
Comment 4 Michael Valenta CLA 2005-06-13 13:07:48 EDT
Looks like the logic in the CVSUIPlugin#openError is wrong. The flag passed 
indicates that only non-team exceptions should be logged. However, the if 
checks for CoreExceptions first. Since a TeamException is a CoreException, it 
gets logged. Not high enough priority for 3.1 so assigning to 3.2.
Comment 5 Michael Valenta CLA 2006-08-17 10:43:06 EDT
We do not plan on addressing this issue in 3.3.
Comment 6 Tomasz Zarna CLA 2007-11-12 18:09:19 EST
I think what we could do here is the check for TeamException _before_ checking for CoreException. Theoretically, if there were a check for a CVSException I would put it before all other checks as it's located lower in the classes hierarchy. This was my first thought, but I might be missing something. Maybe there is a reason why the checks are the other way round?
Comment 7 Tomasz Zarna CLA 2007-11-27 08:25:17 EST
Created attachment 83860 [details]
Patch

Patch that puts check if an exception is a TeamException before checking for CoreException.
Comment 8 Tomasz Zarna CLA 2007-11-27 08:31:24 EST
Szymon, could you take a look at the patch?
Comment 9 Szymon Brandys CLA 2007-11-28 10:10:25 EST
Created attachment 83982 [details]
My proposal

I would make a little change in the patch.
Comment 10 Tomasz Zarna CLA 2007-11-28 12:23:51 EST
As the flags are exclusive, I think we don't have to (or even we shouldn't) check for LOG_CORE_EXCEPTIONS when an exception is of TeamException type. That's why I would stay with the first patch. Of course, we could comment those flags, to make sure they are properly used.

BTW, applying your patch Simon, wouldn't fix the bug anyway.
Comment 11 Szymon Brandys CLA 2007-11-28 12:53:36 EST
Right, the names of the constants are confusing. Team Exceptions are Core Exceptions too. So either the code should be fixed or comments should be added.
The appropriate comments are enough though. 

Comment 12 Tomasz Zarna CLA 2007-11-30 09:39:39 EST
On second thoughts, I think we should combine both patches (ie. add "|| (flags & PERFORM_SYNC_EXEC) > 0" to flag check for Team and Core Exceptions). I'm guessing here...

Micheal, could you shed some light on how those flags are intended to be use? I've been tracking where and how they're set but I'd prefer not base only on my assumptions. I couldn't find any other clues.
Comment 13 Michael Valenta CLA 2007-11-30 10:07:28 EST
I really don't recall what the semantics of the flags is supposed to be. I think it would make sense to separate the two flags. That is, the "log team" flag would log team exceptions and the "log core" would log core exceptions that are not team exceptions. Perhaps the name of the "log core" flag could be change to "log none team core" and you could create a combined flag called "log core" that conbined the two. This would make the semantics more explicit.

As for the sync flag, you only need to set that if you are calling openError from a none UI thread. This flag was added before I knw the trick for determing if you ar ein the UI thread or not (i.e. Display.getCurrent() is null if you are not in the UI thread). It would be better to detect this in the opneError method and do the sync if required.
Comment 14 Tomasz Zarna CLA 2007-12-03 08:39:13 EST
Created attachment 84311 [details]
Patch #3
Comment 15 Tomasz Zarna CLA 2007-12-03 08:51:38 EST
 (In reply to comment #13)
> I think it would make sense to separate the two flags. That is, the "log team" flag
> would log team exceptions and the "log core" would log core exceptions that are
> not team exceptions. Perhaps the name of the "log core" flag could be change to
> "log none team core" and you could create a combined flag called "log core" that
> conbined the two. This would make the semantics more explicit.

Good idea. I've separated and described the flags.

> It would be better to detect this [PERFORM_SYNC_EXEC flag] in the opneError method
> and do the sync if required.

It's done in openDialog method.

Szymon, could you take a look at the latest patch? I hope this one will be more in your type :)
Comment 16 Tomasz Zarna CLA 2007-12-10 07:51:12 EST
Released to HEAD.
Comment 17 Tomasz Zarna CLA 2007-12-12 08:35:06 EST
Verified by code inspection.