You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by va...@apache.org on 2016/08/21 19:39:25 UTC
lucene-solr:master: SOLR-9428: Improve logging to log root cause
Repository: lucene-solr
Updated Branches:
refs/heads/master c164d7f2b -> 364a29c0a
SOLR-9428: Improve logging to log root cause
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/364a29c0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/364a29c0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/364a29c0
Branch: refs/heads/master
Commit: 364a29c0ab151d4e3bf1bebbbbed83b9b1830abb
Parents: c164d7f
Author: Varun Thacker <va...@apache.org>
Authored: Mon Aug 22 01:08:36 2016 +0530
Committer: Varun Thacker <va...@apache.org>
Committed: Mon Aug 22 01:08:47 2016 +0530
----------------------------------------------------------------------
.../java/org/apache/solr/rest/ManagedResourceStorage.java | 9 +++++----
.../java/org/apache/solr/common/cloud/ZkStateReader.java | 6 ++----
2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/364a29c0/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java b/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java
index 230bf44..9db2fd2 100644
--- a/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java
+++ b/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java
@@ -84,7 +84,7 @@ public abstract class ManagedResourceStorage {
* whether the core is running in cloud mode as well as initArgs.
*/
public static StorageIO newStorageIO(String collection, SolrResourceLoader resourceLoader, NamedList<String> initArgs) {
- StorageIO storageIO = null;
+ StorageIO storageIO;
SolrZkClient zkClient = null;
String zkConfigName = null;
@@ -94,9 +94,10 @@ public abstract class ManagedResourceStorage {
zkConfigName = ((ZkSolrResourceLoader)resourceLoader).getZkController().
getZkStateReader().readConfigName(collection);
} catch (Exception e) {
- log.error("Failed to get config name for collection {} due to: {}",
- collection, e.toString());
- }
+ log.error("Failed to get config name due to", e);
+ throw new SolrException(ErrorCode.SERVER_ERROR,
+ "Failed to load config name for collection:" + collection + " due to: ", e);
+ }
if (zkConfigName == null) {
throw new SolrException(ErrorCode.SERVER_ERROR,
"Could not find config name for collection:" + collection);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/364a29c0/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index a3de324..b89da93 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -192,10 +192,8 @@ public class ZkStateReader implements Closeable {
} else {
throw new ZooKeeperException(ErrorCode.INVALID_STATE, "No config data found at path: " + path);
}
- } catch (KeeperException e) {
- throw new SolrException(ErrorCode.SERVER_ERROR, "Error loading config name for collection " + collection, e);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
+ } catch (KeeperException| InterruptedException e) {
+ SolrZkClient.checkInterrupted(e);
throw new SolrException(ErrorCode.SERVER_ERROR, "Error loading config name for collection " + collection, e);
}