-
Bug Report
-
Resolution: Unresolved
-
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.