abaf816d00
This commit removes and now forbids use of org.apache.lucene.index.IndexWriter#isLocked as this method was deprecated in LUCENE-6508. The deprecation is due to the fact that checking if a lock is held before acquiring that lock is subject to a time-of-check-to-time-of-use race condition. There were three uses of IndexWriter#isLocked in the code base: - a logging statement in o.e.i.e.InternalEngine where we are already in an exceptional condition that the lock was held; in this case, logging whether or not the directory is locked is superfluous - in o.e.c.l.u.VersionsTests where we were verifying that a write lock is released upon closing an IndexWriter; in this case, the check is not needed as successfully closing an IndexWriter releases its write lock - in o.e.t.s.MockFSDirectoryService where we were verifying that a directory is not write-locked before (implicitly) trying to obtain such a write lock in org.apache.lucene.index.CheckIndex#<init> (this is the exact type of a situation that is subject to a race condition); in this case we can proceed by just (implicitly) trying to obtain the write lock and failing if we encounter a LockObtainFailedException |
||
---|---|---|
.. | ||
fixtures | ||
framework | ||
build.gradle |