cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 129980 - Excessive logging of exceptions for unknown files
: Excessive logging of exceptions for unknown files
Status: RESOLVED FIXED
: versioncontrol
Mercurial
: 6.1
: All All
: P3 (vote)
: 6.1
Assigned To:
:
:
:
: PERFORMANCE
:
:
  Show dependency treegraph
 
Reported: 2008-03-13 00:49 by
Modified: 2008-03-20 09:58 (History)
Issue Type: DEFECT
:


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


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-03-13 00:49:39
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.

java.io.IOException: Unable to get BASE revision of
/Users/tim/nbsrc/contrib/hexeditor/nbproject/project.xml
[catch] at
org.netbeans.modules.mercurial.Mercurial.getOriginalFile(Mercurial.java:323)
    at
org.netbeans.modules.mercurial.MercurialVCS.getOriginalFile(MercurialVCS.java:109)
    at
org.netbeans.modules.versioning.diff.DiffSidebar.getText(DiffSidebar.java:753)
    at
org.netbeans.modules.versioning.diff.DiffSidebar.access$900(DiffSidebar.java:88)
    at
org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.fetchOriginalContent(DiffSidebar.java:704)
    at
org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.computeDiff(DiffSidebar.java:677)
    at
org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.run(DiffSidebar.java:667)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
    at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
------- Comment #1 From 2008-03-13 09:09:08 -------
We are doing essestially the same as the Subversion module here.

Transferring to versioning for further evaluation.
------- Comment #2 From 2008-03-17 14:12:08 -------
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 From 2008-03-18 12:22:33 -------
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 From 2008-03-18 12:41:42 -------
I have just seen the problem happen.
------- Comment #5 From 2008-03-18 13:57:15 -------
Created an attachment (id=58577) [details]
proposed patch
------- Comment #6 From 2008-03-18 14:08:28 -------
Patch committed in changeset 73978:cb2d91802f02.
------- Comment #7 From 2008-03-20 09:58:26 -------
*** Issue 128402 has been marked as a duplicate of this issue. ***