[
https://issues.apache.org/jira/browse/LUCENE-5624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13976735#comment-13976735
]
Robert Muir commented on LUCENE-5624:
-------------------------------------
Here is the bug:
{code}
Index: src/java/org/apache/lucene/store/NativeFSLockFactory.java
===================================================================
--- src/java/org/apache/lucene/store/NativeFSLockFactory.java (revision
1589085)
+++ src/java/org/apache/lucene/store/NativeFSLockFactory.java (working copy)
@@ -150,7 +150,7 @@
boolean success = false;
try {
lock = channel.tryLock();
- success = true;
+ success = lock != null;
} catch (IOException | OverlappingFileLockException e) {
// At least on OS X, we will sometimes get an
// intermittent "Permission Denied" IOException,
{code}
We leak a handle (The channel) when tryLock() returns null, but there is no
exception.
I can fix it this way, or clean up this code a little bit too. Its too
confusing.
> nightly 'test-lock-factory' may leak file handles
> -------------------------------------------------
>
> Key: LUCENE-5624
> URL: https://issues.apache.org/jira/browse/LUCENE-5624
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
>
> https://builds.apache.org/job/Lucene-Solr-NightlyTests-trunk/556/console
> {noformat}
> [LockStressTest1] Exception in thread "main"
> java.nio.file.FileSystemException:
> /usr/home/hudson/hudson-slave/workspace/Lucene-Solr-NightlyTests-trunk/lucene/build/core/lockfactorytest/test-test.lock:
> Too many open files in system
> [LockStressTest1] at
> sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
> [LockStressTest1] at
> sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
> [LockStressTest1] at
> sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
> [LockStressTest1] at
> sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:176)
> [LockStressTest1] at
> java.nio.channels.FileChannel.open(FileChannel.java:287)
> [LockStressTest1] at
> java.nio.channels.FileChannel.open(FileChannel.java:334)
> [LockStressTest1] at
> org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:149)
> [LockStressTest1] at
> org.apache.lucene.store.VerifyingLockFactory$CheckedLock.obtain(VerifyingLockFactory.java:65)
> [LockStressTest1] at org.apache.lucene.store.Lock.obtain(Lock.java:77)
> [LockStressTest1] at
> org.apache.lucene.store.LockStressTest.main(LockStressTest.java:114)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]