You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2025/05/01 05:44:09 UTC

Re: [PR] HDDS-12901. Introduce EventExecutorMetrics instead of setting the metrics props unsafely [ozone]

jojochuang commented on code in PR #8371:
URL: https://github.com/apache/ozone/pull/8371#discussion_r2069873000


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/events/SingleThreadExecutor.java:
##########
@@ -77,42 +59,43 @@ public SingleThreadExecutor(String name, String threadNamePrefix) {
   @Override
   public void onMessage(EventHandler<P> handler, P message, EventPublisher
       publisher) {
-    queued.incr();
+    metrics.incrementQueued();
     executor.execute(() -> {
-      scheduled.incr();
+      metrics.incrementScheduled();
       try {
         handler.onMessage(message, publisher);
-        done.incr();
+        metrics.incrementDone();
       } catch (Exception ex) {
         LOG.error("Error on execution message {}", message, ex);
-        failed.incr();
+        metrics.incrementFailed();
       }
     });
   }
 
   @Override
   public long failedEvents() {
-    return failed.value();
+    return metrics.getFailed();
   }
 
   @Override
   public long successfulEvents() {
-    return done.value();
+    return metrics.getDone();
   }
 
   @Override
   public long queuedEvents() {
-    return queued.value();
+    return metrics.getQueued();
   }
 
   @Override
   public long scheduledEvents() {
-    return scheduled.value();
+    return metrics.getScheduled();
   }
 
   @Override
   public void close() {

Review Comment:
   I'm looking for the usage of these two thread executors and whether or not they are closed explicitly.
   It looks like they are not closed explicitly so this may not be called properly. Probably ok now because they are only initialized once for Recon and SCM.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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