Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 106128 - File locking is slow
File locking is slow
Product: platform
Classification: Unclassified
Component: Filesystems
PC Linux
: P3 (vote)
: 6.x
Assigned To: rmatous
Depends on:
  Show dependency treegraph
Reported: 2007-06-08 13:46 UTC by kirillkh
Modified: 2008-12-22 14:18 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description kirillkh 2007-06-08 13:46:22 UTC
When attempting to find out what makes the javacvs module slow on checkouts,
I've discovered that the underlying reason is a problem in how the filesystem
locks files. Apparently, file-based file locking that is done by
o.n.m.masterfs.filebasedfs.fileobjects.WriteLock class is slow and
disk-intensive. This problem was apparently encountered before (issue #43278),
and solved by introducing a hack. A similar hack could work for javacvs, but
then there are also svn and other VCSs, copying directory trees from one place
to another, etc.

So, after reviewing the issue, my recommendation is to revise the whole locking
mechanism and decide, where file-based locking is unneeded and the "lightweight"
kind of locking could be used instead. Then provide API for outside parties to
do either kind of locking (currently the locks are always file-based, except
when you use the aforementioned hack).

It would also be interesting to find, why exactly file-based locking is so slow
right now. Could it be because it uses FileChannel acquired through
Comment 1 rmatous 2007-09-18 09:25:43 UTC
Too late for 6.0, risky. Should be reevaluated and finally reviewed
Comment 2 Jaroslav Tulach 2007-12-07 14:19:13 UTC
Here is a proposal to eliminate use of filebased locking:
I'd like this to be implemented for 6.1.
Comment 3 rmatous 2007-12-10 17:44:06 UTC
First draft implemented on branch with Tag: masterfs_novcs
Comment 4 rmatous 2008-01-08 13:53:22 UTC
Fixed by merging masterfs_novcs into trunk and by following commit fixing mainly #123542 Simplify MasterFS, do not
delegate on other embedded FS. 

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo