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 225063 - Project infrastructure should be aware of mounted file systems
Summary: Project infrastructure should be aware of mounted file systems
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 7.3
Hardware: PC Solaris
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2013-01-18 13:48 UTC by Alexander Simon
Modified: 2014-09-15 10:51 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
profiling snapshot of opening file in editor (385.38 KB, application/octet-stream)
2013-01-18 13:48 UTC, Alexander Simon
Details
proposed patch (3.61 KB, patch)
2014-09-10 10:41 UTC, Alexander Simon
Details | Diff
proposed patch, version 2 (3.55 KB, patch)
2014-09-10 11:34 UTC, Alexander Simon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2013-01-18 13:48:19 UTC
Created attachment 130363 [details]
profiling snapshot of opening file in editor

Try to open file located in NFS (for example "/net/host/export/....").
IDE open file about 40 seconds.
Root cause is:
IDE try check meaningless files ("/net/pom.xml", "/net/grails-app", "/net/nbproject/project.xml") several times.
Comment 1 Alexander Simon 2013-01-18 13:50:38 UTC
IDE in ergonomics mode, Info:
>Log Session: Friday, January 18, 2013 5:36:33 PM MSK
>System Info: 
  Product Version         = NetBeans IDE Dev (Build 20130117-dd3f9558c33d) (#dd3f9558c33d)
  Operating System        = SunOS version 5.10 running on x86
  Java; VM; Vendor        = 1.7.0_11; Java HotSpot(TM) Client VM 23.6-b04; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.7.0_11-b21
  Java Home               = /usr/jdk/instances/jdk1.7.0_11/jre
  System Locale; Encoding = en (nb); ISO646-US
Comment 2 Jaroslav Tulach 2013-01-23 15:26:55 UTC
What thread are you talking about?
Comment 3 Alexander Simon 2013-01-23 16:10:30 UTC
(In reply to comment #2)
> What thread are you talking about?
File system should not try do file operations with files:
- /net/pom.xml
- /net/grails-app
- /net/nbproject/project.xml
where /net is auto-mounted nfs
Comment 4 Jaroslav Tulach 2013-01-23 17:21:30 UTC
Why not? pom.xml is regular DNS entry. nbproject as well.
Comment 5 Jaroslav Tulach 2013-01-24 11:16:10 UTC
EDT is not blocked, and I don't think I can do anything in filesystems. The report seems to be too vague, marking invalid.
Comment 6 Alexander Simon 2013-02-01 07:31:24 UTC
(In reply to comment #4)
> Why not? pom.xml is regular DNS entry. nbproject as well.
I ageree that /net/pom.xml is valid name.
Could you provide example where /net/pom.xml is regular (plain) file?
Comment 7 Vladimir Voskresensky 2013-04-10 19:04:17 UTC
Jarda, looks like it's the same problem as we saw with
BaseFileObjectTestHid and had to introduce
    public static final HashSet<String> AUTOMOUNT_SET = new HashSet<String>(Arrays.asList("set", "shared", "net", "java", "share", "home", "ws", "ade_autofs")); 

Probably masterfs can optimize some behavior for this folders (i.e. isDirectory, isFile checks)
Comment 8 Tomas Hurka 2013-07-31 12:56:17 UTC
I think this issue can be fixed in NB 7.4 using JDK 7 API. JDK 7 API can detect automount directories so there is no need for explicit list mentioned in comment #7. Such automount directories can be handled differently to optimize isDirectory and isFile. Please evaluate.
Comment 9 Tomas Hurka 2013-07-31 20:59:30 UTC
One more idea: do not use File.exists() to find out if /net/nbproject exists, use java.io.File.listFiles() instead and search results for /net/nbproject.
Comment 10 Vladimir Voskresensky 2013-08-01 07:20:32 UTC
(In reply to comment #9)
> One more idea: do not use File.exists() to find out if /net/nbproject exists,
> use java.io.File.listFiles() instead and search results for /net/nbproject.
On Unix system listFiles can be empty when directory cleared permission, while exists returns true
Comment 11 Jaroslav Tulach 2013-08-01 12:04:00 UTC
(In reply to comment #8)
> JDK 7 API can detect automount directories 

Can you please tell me how? I can't find a way looking at NIO2 Javadoc.
Comment 12 Tomas Hurka 2013-08-07 07:15:41 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > One more idea: do not use File.exists() to find out if /net/nbproject exists,
> > use java.io.File.listFiles() instead and search results for /net/nbproject.
> On Unix system listFiles can be empty when directory cleared permission, while
> exists returns true
.. but this is not the case for auto-mounted directories like /net
Comment 13 Vladimir Voskresensky 2013-08-07 07:22:48 UTC
(In reply to comment #12)
> (In reply to comment #10)
> > (In reply to comment #9)
> > > One more idea: do not use File.exists() to find out if /net/nbproject exists,
> > > use java.io.File.listFiles() instead and search results for /net/nbproject.
> > On Unix system listFiles can be empty when directory cleared permission, while
> > exists returns true
> .. but this is not the case for auto-mounted directories like /net
with "/net" even more problems if use listFiles (while No problems with permissions).
"/net" list of files can be empty until mount point not used or changing. 
It's easy to see even in shell:
#ls /net
enum                 volvo
#ls -d /net/everest
#ls /net
enum                 everest              volvo

so /net/everest is valid even if not in initial listFiles for "/net" => exists more correct, because it force mounting
Comment 14 Jaroslav Tulach 2013-08-07 11:11:59 UTC
(In reply to comment #11)
> (In reply to comment #8)
> > JDK 7 API can detect automount directories 
> Can you please tell me how? I can't find a way looking at NIO2 Javadoc.

Here is a sample:
http://hg.netbeans.org/releases/file/2360a723964c/cnd.discovery/src/org/netbeans/modules/cnd/discovery/performance/FileSystemChecker.java
Comment 15 Jaroslav Tulach 2014-02-04 07:25:21 UTC
Is there anyone needing this so much to propose a patch?
Comment 16 Alexander Simon 2014-09-10 10:36:47 UTC
Ok, It seems FS should not restrict access to /net folder access.
Instead clients should not check metainfo in /net folder.
First part of the fix was done in the bug #238210
I suggest to fix project owner query.
Comment 17 Alexander Simon 2014-09-10 10:41:13 UTC
Created attachment 149111 [details]
proposed patch

reuse already defined forbidden folders
Comment 18 Vladimir Voskresensky 2014-09-10 11:02:55 UTC
I'm fine with patch. The only comment is: 
Shouldn't we introduce dedicated system property name and use the one from versioning as fallback, like:
System.getProperty("project.forbiddenFolders",System.getProperty("versioning.forbiddenFolders", ""))
Comment 19 Alexander Simon 2014-09-10 11:34:42 UTC
Created attachment 149113 [details]
proposed patch, version 2

fixed forbidden list:
String forbidden = System.getProperty("project.forbiddenFolders", System.getProperty("versioning.forbiddenFolders", ""));
Comment 20 Alexander Simon 2014-09-11 09:31:07 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/4ba9dd6fbf68
Comment 21 Quality Engineering 2014-09-12 02:38:34 UTC
Integrated into 'main-silver', will be available in build *201409120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4ba9dd6fbf68
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug 225063 Project infrastructure should be aware of mounted file systems