[ 
https://issues.apache.org/jira/browse/IGNITE-22192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Lapin updated IGNITE-22192:
-------------------------------------
    Description: 
If logPush exporter is enabled in the configuration, it gets started twice. 
This seems to happen because exporters are first started during MetricManager 
start, and then, as a reaction to configuration update (which happens a bit 
later, in IgniteImpl#recoverComponentsStateOnStart().
h3. Upd 1

Let’s just rewrite a bit
{noformat}
private <T extends ExporterView> void checkAndStartExporter(String 
exporterName, T exporterConfiguration) {
    MetricExporter<T> exporter = availableExporters.get(exporterName);

    if (exporter != null) {
        enabledMetricExporters.computeIfAbsent(exporter.name(), name -> {
            try {
                exporter.start(metricsProvider, exporterConfiguration);
                return exporter;
            } catch (Exception e) {
                // TODO log.
                return null;
            }
        });
    } else {
        log.warn("Received configuration for unknown metric exporter with the 
name '" + exporterName + "'");
    }
}{noformat}
and add test of course.

  was:If logPush exporter is enabled in the configuration, it gets started 
twice. This seems to happen because exporters are first started during 
MetricManager start, and then, as a reaction to configuration update (which 
happens a bit later, in IgniteImpl#recoverComponentsStateOnStart().


> Metric exporters are started twice
> ----------------------------------
>
>                 Key: IGNITE-22192
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22192
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Roman Puchkovskiy
>            Assignee: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3
>
> If logPush exporter is enabled in the configuration, it gets started twice. 
> This seems to happen because exporters are first started during MetricManager 
> start, and then, as a reaction to configuration update (which happens a bit 
> later, in IgniteImpl#recoverComponentsStateOnStart().
> h3. Upd 1
> Let’s just rewrite a bit
> {noformat}
> private <T extends ExporterView> void checkAndStartExporter(String 
> exporterName, T exporterConfiguration) {
>     MetricExporter<T> exporter = availableExporters.get(exporterName);
>     if (exporter != null) {
>         enabledMetricExporters.computeIfAbsent(exporter.name(), name -> {
>             try {
>                 exporter.start(metricsProvider, exporterConfiguration);
>                 return exporter;
>             } catch (Exception e) {
>                 // TODO log.
>                 return null;
>             }
>         });
>     } else {
>         log.warn("Received configuration for unknown metric exporter with the 
> name '" + exporterName + "'");
>     }
> }{noformat}
> and add test of course.



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

Reply via email to