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 200532 - External changes are not detected properly when project folder is NFS mounted.
Summary: External changes are not detected properly when project folder is NFS mounted.
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.1
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-29 19:50 UTC by phoenix_jwt
Modified: 2011-12-09 09:22 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description phoenix_jwt 2011-07-29 19:50:52 UTC
## Description

When a 'PHP Application With External Sources' project's directory is an NFS mount, external changes to the project files (i.e., changes made directly on the system exporting the NFS mount) causes undesirable behavior in NetBeans:

  - Filesystem changes (moved/renamed files, etc.) will not appear at all in the Projects view.
  - Files that were modified externally will not open in NetBeans at all; the IDE must be quit and relaunched first.

Quitting and relaunching NetBeans IDE will resolve the issue (until external changes are made again).

## Steps to reproduce:

- System A is the system on which the NetBeans IDE is running.
- System B is another system (e.g., virtual machine) exporting the project files via NFS.

1. Mount the NFS share containing the code files from System B onto System A.
  - I'm using autofs on Mac to automount the share.  I have not tested it with a manual mount.
2. Create a new "PHP Application With Existing Sources" project and set its "Sources Folder" to the mounted NFS share.
3. Make a change to the files on System B.
4. The changes will not be reflected in NetBeans:
  - Filesystem changes (moved/renamed files, etc.) will not appear at all in the Projects view.
  - Files that were modified externally will not open in NetBeans at all; the IDE must be quit and relaunched first.

## Additional information:

Problem can be reproduced consistently with the following setup:

- System A (NetBeans):  Mac OS 10.5 (using Apple's autofsd, which might operate differently from *nix's autofs), NetBeans 7.1, PHP plugin 1.22

- System B (NFS Server):  CentOS 6, nfs-utils.i686 1:1.2.2-7.el6
Comment 1 Tomas Mysik 2011-07-30 08:15:49 UTC
Reassigning to the proper component, please evaluate. Thanks.
Comment 2 Jaroslav Tulach 2011-08-01 05:57:00 UTC
Since 7.0 NetBeans rely on inotify & similar OS tools to deliver events about changed files. In case you have NFS mount and make changes from "system B", the "system A" does not deliver any changes (probably).

There is not much to do about it, except to return back to pre-7.0 behavior:

a) Run with -J-Dorg.netbeans.modules.masterfs.watcher.disable=true
b) install "Scan On Demand" module and refresh folders manually: http://wiki.netbeans.org/ScanOnDemand

Let us know if one of the above works for you.
Comment 3 phoenix_jwt 2011-08-02 15:46:19 UTC
Installing the Scan on Demand module does work around the issue (although it does introduce an undesirable side effect - NetBeans no longer auto-scans my project, which causes problems when e.g., adding new libraries to the project's Include Path).

I will try setting the -J-Dorg.netbeans.modules.masterfs.watcher.disable=true flag in netbeans.conf and see if that has an effect.

I apologize for mentioning the E-word, but I have noticed that Eclipse does not have this problem (verified in PyDev project).  Perhaps Eclipse simply works similarly to NetBeans's pre-7 behavior, but it does make me curious whether there might be an additional alternative that has not been considered?
Comment 4 phoenix_jwt 2011-08-02 15:54:09 UTC
Adding `-J-Dorg.netbeans.modules.masterfs.watcher.disable=true` to netbeans.conf does appear to solve the problem without introducing any significant side effects.
Comment 5 Jaroslav Tulach 2011-08-05 12:27:11 UTC
Good to know alternatives exists. Re. E!E - I guess they don't scan sources for external changes at all. Probably only detect the change when a file is being open. If you can investigate more about the actual behavior, we may try to mimic it.
Comment 6 Tomas Zezula 2011-08-05 12:30:25 UTC
On remote disks (NFS, SMB, iPod) the native notification does not work on Mac.
But the the core.framework can tell you all the mount points.
Comment 7 phoenix_jwt 2011-08-06 16:39:07 UTC
Do you think there might be an option or flag I can set, either on the NFS server or in OS X's autofs that might have an effect on this behavior?

I'm unfortunately not knowledgeable enough to do all the research on my own, but if you could explain to me what I need to ask for, I am more than happy to do the legwork to post around on e.g., Stackoverflow to gather more information on the different systems involved and what might be going on (or not, as the case may be).
Comment 8 Tomas Zezula 2011-08-08 07:59:26 UTC
As far as I know (but I am not NFS expert) the inotify (used on linux for native listening) does not support it. The FAM (file access monitor) supported it in some way for NFS.
Comment 9 marcusson 2011-12-08 14:42:04 UTC
Are you REALLY sure you don't want to fix this?

Other editors don't have that issue, it is easy to fix and the problem is a SHOWSTOPPER at least for all people in my office.

Suggested fix:

Other editors simply check the "last modified" date of
a) either the files that are currently open, OR
b) at least the 1 file that currently has the focus in the editor.
There is no need to check the whole project (other editors don't do it either), but for the files that are currently open, the effect is quite noticeable (and annoying).

The problem is obviously easy to fix for 80% (of all common cases in everyday work) with little overhead. So why don't give it a try.
Comment 10 Jaroslav Tulach 2011-12-08 17:58:00 UTC
I have a feeling our editor checks the timestamps. If not, we can fix it. However this is far from the scope of the original bug report. Probably just report new bug for platform/text.
Comment 11 marcusson 2011-12-09 09:22:25 UTC
Thank you. As requested I opened a new issue: Bug 206182.