jt2594838 commented on code in PR #18562:
URL: https://github.com/apache/iotdb/pull/18562#discussion_r3912295278


##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/prometheus/PrometheusReporter.java:
##########
@@ -135,6 +189,63 @@ public boolean start() {
     return true;
   }
 
+  @SuppressWarnings("unsafeThreadSchedule")
+  private void startSnapshotUpdater() {
+    // Keep metric collection off Reactor HTTP threads and avoid overlapping 
scrapes.
+    if (snapshotUpdateExecutor == null || snapshotUpdateExecutor.isShutdown()) 
{
+      // Create a fresh executor for every start so a stopped reporter can be 
started again with
+      // the same managed thread-pool factory.
+      snapshotUpdateExecutor = 
Objects.requireNonNull(snapshotUpdateExecutorSupplier.get());

Review Comment:
   Caideyipi P2 fixed: the reporter now stores a scheduler factory and invokes 
it on every start, so stop/start and failed-start retries receive a fresh 
executor. The service supplies an IoTDB-managed factory, preserving 
JMX/ThreadPoolMetrics registration and the Prometheus thread classification 
across restarts; the standalone constructor retains its daemon executor 
fallback.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to