You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2013/08/14 14:02:15 UTC
svn commit: r1513824 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java
Author: markrmiller
Date: Wed Aug 14 12:02:14 2013
New Revision: 1513824
URL: http://svn.apache.org/r1513824
Log:
SOLR-5133: HdfsUpdateLog can fail to close a FileSystem instance if init is called more than once.
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java
Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1513824&r1=1513823&r2=1513824&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Wed Aug 14 12:02:14 2013
@@ -91,6 +91,10 @@ Bug Fixes
* SOLR-5119: Managed schema problems after adding fields via Schema Rest API.
(Nils Kübler, Steve Rowe)
+
+* SOLR-5133: HdfsUpdateLog can fail to close a FileSystem instance if init
+ is called more than once. (Mark Miller)
+
Optimizations
----------------------
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java?rev=1513824&r1=1513823&r2=1513824&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java Wed Aug 14 12:02:14 2013
@@ -42,22 +42,18 @@ import org.apache.solr.util.IOUtils;
/** @lucene.experimental */
public class HdfsUpdateLog extends UpdateLog {
- private FileSystem fs;
- private Path tlogDir;
- private String confDir;
+ private volatile FileSystem fs;
+ private volatile Path tlogDir;
+ private final String confDir;
public HdfsUpdateLog() {
-
+ this.confDir = null;
}
public HdfsUpdateLog(String confDir) {
this.confDir = confDir;
}
- public FileSystem getFs() {
- return fs;
- }
-
// HACK
// while waiting for HDFS-3107, instead of quickly
// dropping, we slowly apply
@@ -118,6 +114,14 @@ public class HdfsUpdateLog extends Updat
}
try {
+ if (fs != null) {
+ fs.close();
+ }
+ } catch (IOException e) {
+ throw new SolrException(ErrorCode.SERVER_ERROR, e);
+ }
+
+ try {
fs = FileSystem.newInstance(new Path(dataDir).toUri(), getConf());
} catch (IOException e) {
throw new SolrException(ErrorCode.SERVER_ERROR, e);