activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r808041 - /activemq/trunk/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java
Date Wed, 26 Aug 2009 15:09:02 GMT
Author: gtully
Date: Wed Aug 26 15:09:02 2009
New Revision: 808041

URL: http://svn.apache.org/viewvc?rev=808041&view=rev
Log:
resolve fd leak in locking logic, cause slave to exhaust fds and fail

Modified:
    activemq/trunk/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java

Modified: activemq/trunk/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java
URL: http://svn.apache.org/viewvc/activemq/trunk/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java?rev=808041&r1=808040&r2=808041&view=diff
==============================================================================
--- activemq/trunk/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java (original)
+++ activemq/trunk/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java Wed Aug 26 15:09:02
2009
@@ -55,7 +55,9 @@
         }
         
         IOHelper.mkdirs(file.getParentFile());
-        readFile = new RandomAccessFile(file, "rw");        
+        if (readFile == null) {
+            readFile = new RandomAccessFile(file, "rw");
+        }
         if (lock == null) {
             try {
                 lock = readFile.getChannel().tryLock();



Mime
View raw message