: >> So what/how should we document all of this?
        ...
: > I've got more info on this.

Mark: most of what you wrote is above my head, but since you fixed a 
grammar error in my updated example solrconfig.xml comment w/o making any 
content changes, I'm assuming you feel what i put there is sufficient.

Most of your comments feel like they should be raised over in Lucene-Java 
land, at a minimum in documentation (added to the AvailableLockFactories 
page perhaps) or possibly in some code changes (should we changed the 
default LockFactory depending on Java version?)

I'll leave that up to you, since (as i mentioned) i didnt' understand half 
of it.

: > Checking for OverlappingFileLockException *should* actually work when
: > using Java 1.6. Java 1.6 started using a *system wide* thread safe check
: > for this.
: >
: > Previous to Java 1.6, checks for this *were* limited to an instance of
: > FileChannel - the FileChannel maintained its own personal lock list. So
: > you have to use
: > the same Channel to even have any hope of seeing an
: > OverlappingFileLockException. Even then though, its not properly thread
: > safe. They did not sync across
: > checking if the lock exists and acquiring the lock - they separately
: > sync each action - leaving room to acquire the lock twice from two
: > different threads like I was seeing.
: >
: > Interestingly, Java 1.6 has a back compat mode you can turn on that
: > doesn't use the system wide lock list, and they have fixed this thread
: > safety issue in that impl - there is a sync across checking
: > and getting the lock so that it is properly thread safe - but not in
: > Java 1.4, 1.5.
: >
: > Looking at GCC - uh ... I don't think you want to use GCC - they don't
: > appear to use a lock list and check for this at all :)
: >
: > But the point is, this is fixable on Java 6 if we check for
: > OverlappingFileLockException - it *should* work across webapps, and it
: > is actually thread safe, unlike Java 1.4,1.5.
: >
: >   
: Another interesting fact:
: 
: On Windows, if you attempt to lock the same file with different channel
: instances pre Java 1.6 - the code will deadlock.
: 
: -- 
: - Mark
: 
: http://www.lucidimagination.com
: 
: 
: 



-Hoss

Reply via email to