resolve fd leak in locking logic, cause slave to exhaust fds and fail

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@808041 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-08-26 15:09:02 +00:00
parent 30db300a1a
commit 589f9241fe
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ public class LockFile {
}
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();