mirror of https://github.com/apache/lucene.git
SOLR-11413: SolrGraphiteReporter fails to report metrics due to non-thread safe code.
This commit is contained in:
parent
cc519b9ddd
commit
c8d55cc6d4
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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! -->
|
||||
|
|
Loading…
Reference in New Issue