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 218234 - Accessing file system in EDT: 3 times File.isFile on editor tab switch
Summary: Accessing file system in EDT: 3 times File.isFile on editor tab switch
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: David Strupl
URL:
Keywords:
: 218236 (view as bug list)
Depends on:
Blocks: 218138
  Show dependency tree
 
Reported: 2012-09-12 15:06 UTC by Egor Ushakov
Modified: 2012-12-22 02:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktrace1 (4.92 KB, text/plain)
2012-09-12 15:06 UTC, Egor Ushakov
Details
stacktrace2 (4.92 KB, text/plain)
2012-09-12 15:07 UTC, Egor Ushakov
Details
stacktrace3 (4.92 KB, text/plain)
2012-09-12 15:07 UTC, Egor Ushakov
Details
canWrite stack trace (4.84 KB, text/plain)
2012-09-20 15:55 UTC, Egor Ushakov
Details
patch-for-test-01 (1.21 KB, patch)
2012-12-19 16:12 UTC, David Strupl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2012-09-12 15:06:27 UTC
see 3 attached stack traces, on every editor tab switch we access file system from EDT at least 3 times, this freezes IDE when accessing files through slow NFS.
Comment 1 Egor Ushakov 2012-09-12 15:06:50 UTC
Created attachment 124253 [details]
stacktrace1
Comment 2 Egor Ushakov 2012-09-12 15:07:13 UTC
Created attachment 124254 [details]
stacktrace2
Comment 3 Egor Ushakov 2012-09-12 15:07:29 UTC
Created attachment 124255 [details]
stacktrace3
Comment 4 Egor Ushakov 2012-09-20 15:54:27 UTC
to make it worse FileObj.canWrite does a couple fs requests: 
- File.isFile (stack traces already attached)
- File.canWrite (see the new stack trace)
Comment 5 Egor Ushakov 2012-09-20 15:55:07 UTC
Created attachment 124659 [details]
canWrite stack trace
Comment 6 Egor Ushakov 2012-10-02 11:51:23 UTC
As far as I understand, all of this is actually done just to change (if needed) name font to italic, which probably could be checked off the EDT and updated later.
Comment 7 Egor Ushakov 2012-10-31 16:34:02 UTC
here is a slowness report:
http://statistics.netbeans.org/analytics/exception.do?id=624085
Comment 8 Egor Ushakov 2012-10-31 16:38:14 UTC
and it looks like many of the latest reports in:
http://statistics.netbeans.org/analytics/detail.do?id=168161
are about the same issue
Comment 9 David Strupl 2012-12-19 13:49:51 UTC
I am having a look ...
Comment 10 David Strupl 2012-12-19 16:12:42 UTC
Created attachment 129548 [details]
patch-for-test-01
Comment 11 David Strupl 2012-12-19 16:16:06 UTC
I have attached a small patch that should help. BUT I don't know whether it can cause some regression. Passing to the owner of multi view where the patch is done for evaluation. Also as I did not know the correct owner I have tried window system (if multiview is handled by someone else please re-assigne).

Egor, can you also please try the attached patch whether it will help (and not cause a regression)? Thanks a lot, David
Comment 12 Egor Ushakov 2012-12-19 17:03:30 UTC
Thanks David, I've tried it and it works fine! No fs access from EDT during tab switches.
Comment 13 David Strupl 2012-12-19 19:44:14 UTC
Thanks for the test! Now we need to make sure that the patch will not cause a regression. Especially whether the name will be always correctly displayed on multiview. After the change is reviewed I will apply the patch ...
Comment 14 Stanislav Aubrecht 2012-12-20 09:13:19 UTC
I have no idea what EditorSupport does when updating name, reassigning to openide.text owner.
Comment 15 David Strupl 2012-12-20 10:11:39 UTC
If there are not objections, I will apply the patch.
Comment 16 David Strupl 2012-12-20 10:23:24 UTC
Changeset: 7da69869efb8
Author:    David Strupl <dstrupl@netbeans.org>
Date:      2012-12-20 11:21
Message:   Do not call updateName when the editor becomes visible (e.g. after switching tabs).
Comment 17 David Strupl 2012-12-20 10:28:13 UTC
*** Bug 218236 has been marked as a duplicate of this bug. ***
Comment 18 Quality Engineering 2012-12-22 02:29:06 UTC
Integrated into 'main-golden', will be available in build *201212220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7da69869efb8
User: David Strupl <dstrupl@netbeans.org>
Log: Issue #218234 - Accessing file system in EDT: 3 times File.isFile on editor tab switch
Do not call updateName when the editor becomes visible (e.g. after switching tabs).