Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14612

MeterLogManager throws NPE when metrics are disabled

XMLWordPrintable

    • Icon: Bug Report Bug Report
    • Resolution: Unresolved
    • Icon: L3 - Default L3 - Default
    • None
    • 7.17.0
    • None

      Environment (Required on creation):

      all distributions

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      If the application starts with Metrics disabled, the MeterLogManager throws an NPE when migrating a process via batch operation.

      Steps to reproduce (Required on creation):

      With Metrics disabled via "metricEnabled", migrate a process via batch operation.

      Observed Behavior (Required on creation):

      A Null Pointer Exception is thrown in the MeterLogManager.

      Expected behavior (Required on creation):

      No NPE thrown

      Root Cause (Required on prioritization):

      • With "isMetricEnabled" flag disabled, the DbMetricsReporter is not initialized.
          protected void initMetrics() {
            if (isMetricsEnabled) {
        
              if (metricsRegistry == null) {
                metricsRegistry = new MetricsRegistry();
              }
        
              initDefaultMetrics(metricsRegistry);
        
              if (dbMetricsReporter == null) {
                dbMetricsReporter = new DbMetricsReporter(metricsRegistry, commandExecutorTxRequired);
              }
            }
          }
        
      • The MeterLogManager accesses the DbMetricsReporter regardless of the configuration flag
          protected boolean isEndTimeAfterLastReportInterval(MetricsQueryImpl query) {
            long reportingIntervalInSeconds = Context.getProcessEngineConfiguration()
              .getDbMetricsReporter()
              .getReportingIntervalInSeconds();
        
            return (query.getEndDate() == null
                || query.getEndDateMilliseconds()>= ClockUtil.getCurrentTime().getTime() - (1000 * reportingIntervalInSeconds));
          }
        

      Solution Ideas (Optional):

      The MeterLogManager honors the "isMetricEnabled" flag in the configuration and acts accordingly when disabled.

      Hints (optional):

        This is the controller panel for Smart Panels app

              Unassigned Unassigned
              alessandro.cavalli Alessandro Cavalli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: