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 26230 - Native support for filesystems to avoid polling
Summary: Native support for filesystems to avoid polling
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL: http://wiki.netbeans.org/NativeFileNo...
Keywords:
Depends on: 185135 190462 190465 190467 190470 190490 190491 194147 195288 196914 197965 197966 197985
Blocks: 189720
  Show dependency tree
 
Reported: 2002-08-02 17:51 UTC by rmatous
Modified: 2011-04-22 05:34 UTC (History)
13 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Demo app (2.91 KB, text/plain)
2009-03-10 22:24 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rmatous 2002-08-02 17:51:07 UTC
This should improve performance, notification
about changes would be more reliable.
Comment 1 Jesse Glick 2002-08-19 00:39:21 UTC
I have preliminary support for Unix/FAM, needs to be developed further...
Comment 2 Antonin Nebuzelsky 2008-04-15 17:14:46 UTC
Reassigning to new module owner jskrivanek.
Comment 3 Jiri Skrivanek 2008-10-16 14:49:06 UTC
I don't understand what it means. Could you clarify?
Comment 4 Jaroslav Tulach 2008-10-17 12:15:23 UTC
Instead of polling for changes of filesystem by calling FileSystem.refresh(), the masterfs implementation could 
observer the external changes itself: http://search.cpan.org/~mlehmann/Linux-Inotify2-1.2/Inotify2.pm and 
http://www.relisoft.com/win32/watcher.html
Comment 5 rmatous 2008-10-17 12:37:44 UTC
Just FYI:
- RFE means decline from pure java FS impl. 
- future NIO2 effort for jdk could be considered as competing solution
Comment 6 Jesse Glick 2008-10-17 23:18:45 UTC
NIO.2 would I think be the proper internal implementation. (A backport to JDK 6 may be available.)
Comment 7 Jiri Skrivanek 2008-10-20 14:37:49 UTC
So, let's wait for NIO.2.
Comment 8 Jesse Glick 2009-03-10 22:23:31 UTC
It's in JDK 7 betas, so it could be supported at least for people running on JDK 7, offering an opportunity to test
robustness and possible send bug reports back to the JDK 7 team before the release. In my experiments, listening to
every file event created during a clean build of the "gmaven" source tree (consisting of many Maven submodules) and
printing each such event does not add a lot of overhead: maybe 3sec to a 30sec build. Listening only to FileObject
folders which exist in memory would be far cheaper.
Comment 9 Jesse Glick 2009-03-10 22:24:04 UTC
Created attachment 78015 [details]
Demo app
Comment 10 Vitezslav Stejskal 2009-08-18 09:51:42 UTC
Increasing priority, because there is P2 defect in parsing/indexing depending on this.
Comment 11 Jaroslav Tulach 2010-04-07 04:48:29 UTC
Not in near term planes. Subject to change when JDK7 is released. Meanwhile we have home made "recursive listener" with "external changes" detection.
Comment 12 Ondrej Langr 2010-05-06 12:18:14 UTC
Home made "recursive listener" obviously has some issues (see e.g. #157627), so I'm raising priority to bring more attention to this.
Comment 13 Jesse Glick 2010-06-23 00:24:46 UTC
Collecting some background info in wiki.
Comment 14 Petr Nejedly 2010-09-01 14:46:35 UTC
Work started in the core-main repository, branch fs_watches_26230
Comment 15 Jesse Glick 2010-09-20 16:38:03 UTC
Merged so should be FIXED, right?
Comment 16 Egor Ushakov 2010-10-20 19:54:30 UTC
notifier for Solaris based on gamin or fam library:
http://hg.netbeans.org/cnd-main/rev/5fd744c56452
implementation using FEN is still unstable
Comment 17 Jesse Glick 2010-10-20 21:20:36 UTC
(In reply to comment #16)
> implementation using FEN is still unstable

You know there is an impl in JDK 7 to use as an example, right?
Comment 18 Egor Ushakov 2010-10-22 11:46:34 UTC
AFAIK it will use /dev/poll and I'm trying to use FEN
Comment 19 Jesse Glick 2010-10-22 14:19:37 UTC
Are you sure? I'm no expert on this, but SolarisWatchService.java defines constants and structs matching what http://blogs.sun.com/praks/entry/file_events_notification describes.

(It's also worth noting that SolarisWatchService.c is very minimal and looks like it could easily be converted to JNA style.)
Comment 20 Egor Ushakov 2010-10-22 14:21:38 UTC
Thanks, I'll have a look!
Comment 21 Jaroslav Tulach 2010-11-24 21:47:41 UTC
Implemented. Few bugs remain.