You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/09/21 06:59:00 UTC

[jira] [Commented] (SOLR-18455) is too shallow

    [ https://issues.apache.org/jira/browse/SOLR-18455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117629#comment-18117629 ] 

ASF subversion and git services commented on SOLR-18455:
--------------------------------------------------------

Commit 4ceaa3284b8f5ec6c4a58bf851bda7fde42c1a0c in solr's branch refs/heads/main from Mikhail Khludnev
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=4ceaa3284b8 ]

SOLR-18455: actually disable metrics on <metrics enabled="false"/> (#4902)

Co-authored-by: copilot-swe-agent[bot] <19...@users.noreply.github.com>
Co-authored-by: mkhludnev <80...@users.noreply.github.com>

> <metrics enabled=false> is too shallow
> --------------------------------------
>
>                 Key: SOLR-18455
>                 URL: https://issues.apache.org/jira/browse/SOLR-18455
>             Project: Solr
>          Issue Type: Bug
>          Components: metrics
>    Affects Versions: 10.0, main(11.0)
>         Environment: - Solr 11.0.0-SNAPSHOT (`solr-11.0.0-SNAPSHOT-slim`)
> - OpenJDK 21.0.12+8, `-Xmx2g -XX:+UseG1GC`
> - 3 cores, sustained indexing with frequent commits
>            Reporter: Mikhail Khludnev
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 10.1
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> extracted from SOLR-18442
> h2. No way to disable it
> {{<metrics enabled="false"/>}} in {{solr.xml}} does *not* stop this. That flag only short-circuits the suppliers and reporters:
> {code:java}
> // SolrXmlConfig.java:681-688
> private static MetricsConfig getMetricsConfig(ConfigNode metrics) {
>   MetricsConfig.MetricsConfigBuilder builder = new MetricsConfig.MetricsConfigBuilder();
>   boolean enabled = metrics.boolAttr("enabled", true);
>   builder.setEnabled(enabled);
>   if (!enabled) {
>     log.info("Metrics collection is disabled.");
>     return builder.build();
>   }
> {code}
> and the only consumer of the resulting config is the reporter list:
> {code:java}
> // CoreContainer.java:913
> PluginInfo[] metricReporters = cfg.getMetricsConfig().getMetricReporters();
> {code}
> The registration path never consults the flag -- {{SolrMetricManager}} contains no reference to it at all, and goes straight to the meter:
> {code:java}
> // SolrMetricManager.java
> public ObservableLongGauge observableLongGauge(
>     String registry, String gaugeName, String description,
>     Consumer<ObservableLongMeasurement> callback, OtelUnit unit) {
>   return longGaugeBuilder(registry, gaugeName, description, unit).buildWithCallback(callback);
> }
> {code}
> This was confirmed empirically: *the histograms above are from a run with {{<metrics enabled="false"/>}} applied.* Reporting was off; the instruments were still built and still leaked at +623 searchers per ten minutes.
> So an affected node has no configuration escape -- only reducing its commit rate, which slows the leak proportionally without stopping it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org