SOLR-11413: SolrGraphiteReporter fails to report metrics due to non-thread safe code.

This commit is contained in:
Andrzej Bialecki 2017-10-30 12:52:01 +01:00
parent cc519b9ddd
commit c8d55cc6d4
3 changed files with 8 additions and 8 deletions

View File

@ -81,6 +81,8 @@ Bug Fixes
* SOLR-11557: Fix SolrZkClient.checkInterrupted (Tomás Fernández Löbbe)
* SOLR-11413: SolrGraphiteReporter fails to report metrics due to non-thread safe code. (Erik Persson, ab)
Optimizations
----------------------
* SOLR-11285: Refactor autoscaling framework to avoid direct references to Zookeeper and Solr

View File

@ -75,13 +75,11 @@ public class SolrGraphiteReporter extends FilteringSolrMetricReporter {
}
GraphiteSender graphite;
String id = host + ":" + port + ":" + pickled;
graphite = serviceRegistry.getOrCreate(id, () -> {
if (pickled) {
return new PickledGraphite(host, port);
} else {
return new Graphite(host, port);
}
});
if (pickled) {
graphite = new PickledGraphite(host, port);
} else {
graphite = new Graphite(host, port);
}
if (instancePrefix == null) {
instancePrefix = registryName;
} else {

View File

@ -18,7 +18,7 @@
<solr>
<metrics>
<reporter name="test" group="node" class="org.apache.solr.metrics.reporters.SolrGraphiteReporter">
<reporter name="test" group="node,core" class="org.apache.solr.metrics.reporters.SolrGraphiteReporter">
<str name="host">localhost</str>
<int name="port">${mock-graphite-port}</int>
<!-- for unit tests this is set to 1 second - DO NOT USE THIS VALUE IN PRODUCTION! -->