This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 129980 - Excessive logging of exceptions for unknown files
Summary: Excessive logging of exceptions for unknown files
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@versioncontrol
: 128402 (view as bug list)
Depends on:
Reported: 2008-03-13 00:49 UTC by _ tboudreau
Modified: 2008-03-20 09:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

proposed patch (1.55 KB, patch)
2008-03-18 13:57 UTC, Padraig Obriain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2008-03-13 00:49:39 UTC
I have a bunch of local changes to contrib/hexeditor which Mercurial does not yet know about.  My log is filled with stack traces such as the ones below.

Given that this problem will occur any time there is a new file that Mercurial does not know about, it really does not make sense to log a stack trace for 
each one.  Those of us working on our own modules with their own logging find it a lot of noise to dig through.

Also, I would suggest not using exceptions as the mechanism for reporting this situation - creating exceptions is expensive and has an impact on 
performance.  Since this is a perfectly normal situation, and in a normal session with a bunch of new files, thousands of such exceptions can easily be 
thrown, it is very likely to hurt performance. Unable to get BASE revision of /Users/tim/nbsrc/contrib/hexeditor/nbproject/project.xml
[catch] at org.netbeans.modules.mercurial.Mercurial.getOriginalFile(
	at org.netbeans.modules.mercurial.MercurialVCS.getOriginalFile(
	at org.netbeans.modules.versioning.diff.DiffSidebar.getText(
	at org.netbeans.modules.versioning.diff.DiffSidebar.access$900(
	at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.fetchOriginalContent(
	at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.computeDiff(
	at org.netbeans.modules.versioning.diff.DiffSidebar$
	at org.openide.util.RequestProcessor$
	at org.openide.util.RequestProcessor$
Comment 1 Padraig Obriain 2008-03-13 09:09:08 UTC
We are doing essestially the same as the Subversion module here.

Transferring to versioning for further evaluation.
Comment 2 Maros Sandor 2008-03-17 14:12:08 UTC
You have to evaluate the error state in MercurialVCS.getOriginalFile() and only log exceptions that really signal some
exceptional situation. The fact that you won't get a BASE version of a NEW file is certainly not exceptional and you
should not log any error in such case. DiffSidebar does not know about status of your files. I think that check for
STATUS_DIFFABLE fails in Hg for some reason.
Comment 3 Padraig Obriain 2008-03-18 12:22:33 UTC
That the check for STATUS_DIFFABLE fails would explain why we would get an exception.

However, I have not been able to reproduce this problem this morning. When I create a new file its status in
getOriginalFile is LocallyNew and the exception does not occur.

Do you have a reproducible test case for this?
Comment 4 Padraig Obriain 2008-03-18 12:41:42 UTC
I have just seen the problem happen.
Comment 5 Padraig Obriain 2008-03-18 13:57:15 UTC
Created attachment 58577 [details]
proposed patch
Comment 6 Padraig Obriain 2008-03-18 14:08:28 UTC
Patch committed in changeset 73978:cb2d91802f02.
Comment 7 Padraig Obriain 2008-03-20 09:58:26 UTC
*** Issue 128402 has been marked as a duplicate of this issue. ***