private boolean waitForAvailabilityInternal ( ) { final Directory directory = indexManager . getDirectoryProvider ( ) . getDirectory ( ) ; try { Lock lock = directory . obtainLock ( IndexWriter . WRITE_LOCK_NAME ) ; lock . close ( ) ; return true ; } catch ( LockObtainFailedException lofe ) { return false ; } catch ( IOException e ) { log . error ( e ) ; return false ; } }
This is returning as soon as the lock is available or after 10 seconds .