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 229903 - org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get exclusive access to /usr/share/voltdb/src/frontend/org/voltdb/Memory.java@581f8737:4ddd44f9 (probably opened for reading).
Summary: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get exclu...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 252731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-17 07:50 UTC by szmitek
Modified: 2015-08-13 01:18 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 7690


Attachments
stacktrace (9.06 KB, text/plain)
2013-05-17 07:50 UTC, szmitek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description szmitek 2013-05-17 07:50:14 UTC
Build: NetBeans IDE 7.3.1 (Build 201304162201)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Linux

User Comments:
GUEST: start up 6.7 build 200903250219

szmitek: I cannot save Java class.




Stacktrace: 
org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get exclusive access to /usr/share/voltdb/src/frontend/org/voltdb/Memory.java@581f8737:4ddd44f9 (probably opened for reading).
   at org.netbeans.modules.masterfs.filebasedfs.utils.FSException.io(FSException.java:118)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport.addResource(MutualExclusionSupport.java:96)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getOutputStream(FileObj.java:127)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getOutputStream(FileObj.java:102)
   at org.openide.text.DataEditorSupport$Env.outputStream(DataEditorSupport.java:899)
   at org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:1172)
Comment 1 szmitek 2013-05-17 07:50:16 UTC
Created attachment 134556 [details]
stacktrace
Comment 2 Jaroslav Havlin 2013-08-16 08:26:39 UTC
Probably the file was really being read by some other thread (scanning) when you tried to save it. Was you able to save the file finally (after several attempts)?

The log shows that it's not possible to add more native filesystem watches.
It seems that you have a lot files in your opened projects. Is that assumption correct?

Can you please generate a thread dump (or profiler snapshot) when it happens again and attach it to this issue? See http://wiki.netbeans.org/GenerateThreadDump.

Thank you.
Comment 3 Jaroslav Havlin 2013-08-22 11:56:43 UTC
Closing the issue for now, please provide requested information and reopen it.
Thanks.
Comment 4 freephile 2014-12-29 17:05:04 UTC
This is happening for me too.

I'm running NetBeans IDE 8.0.2 on Ubuntu, working on a PHP project where the filesystem is exported [1] by the host to a VirtualBox guest (also running Ubuntu).  Specifically, I'm using the Mediawiki-Vagrant setup [2].  It seems that the guest is busy reading the exported filesystem, which prevents NetBeans from saving the file.

It doesn't always happen; only intermittently.

When it does happen, I can always save the file after multiple attempts, so it's a contention issue.  It's obviously a major thorn to have to attempt to save a file repeatedly.

I hope this helps to resolve the issue in NetBeans, or to identify setup and configuration best practices with other technologies like VirtualBox where you want to share filesystems.

[1] This is the line from /etc/exports
"/home/greg/vagrant" 10.11.12.13(rw,no_subtree_check,all_squash,anonuid=1000,anongid=1000,fsid=1511390458)

[2] http://mediawiki.org/wiki/MediaWiki-Vagrant
Comment 5 Jaroslav Havlin 2015-08-11 11:38:21 UTC
http://hg.netbeans.org/core-main/rev/be8a9c677b1a
If we know that the filesystem is slow or busy for some reason, we should be able to configure the timeout for getting the lock.

When the changeset gets into the development build (you will be notified by a comment), please try running it with this parameter:

-J-Dorg.netbeans.modules.masterfs.mutualexclusion.tries=50

(Each try waits 200 ms, default value is 10 tries.)

Thank you for reporting and help.
Comment 6 Jaroslav Havlin 2015-08-11 11:43:57 UTC
*** Bug 252731 has been marked as a duplicate of this bug. ***
Comment 7 Quality Engineering 2015-08-13 01:18:53 UTC
Integrated into 'main-silver', will be available in build *201508130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/be8a9c677b1a
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #229903: Make number of tries in MutualExclusionSupport configurable