You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2016/12/29 04:27:16 UTC
lucene-solr:master: SOLR-9877: Null check for metric registry before
attempting to use it
Repository: lucene-solr
Updated Branches:
refs/heads/master 20362deb7 -> 662be93ed
SOLR-9877: Null check for metric registry before attempting to use it
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/662be93e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/662be93e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/662be93e
Branch: refs/heads/master
Commit: 662be93ed11abebaff1d13711f3bffca478ba61e
Parents: 20362de
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Thu Dec 29 09:57:03 2016 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Thu Dec 29 09:57:03 2016 +0530
----------------------------------------------------------------------
.../solr/util/stats/InstrumentedHttpRequestExecutor.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/662be93e/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java b/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
index ad76d73..0426780 100644
--- a/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
+++ b/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
@@ -53,11 +53,16 @@ public class InstrumentedHttpRequestExecutor extends HttpRequestExecutor impleme
@Override
public HttpResponse execute(HttpRequest request, HttpClientConnection conn, HttpContext context) throws IOException, HttpException {
- final Timer.Context timerContext = timer(request).time();
+ Timer.Context timerContext = null;
+ if (metricsRegistry != null) {
+ timerContext = timer(request).time();
+ }
try {
return super.execute(request, conn, context);
} finally {
- timerContext.stop();
+ if (timerContext != null) {
+ timerContext.stop();
+ }
}
}