You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/04/30 11:41:48 UTC

[GitHub] [hbase] Apache9 commented on a diff in pull request #4381: HBASE-26986 Trace Master Procedure Execution

Apache9 commented on code in PR #4381:
URL: https://github.com/apache/hbase/pull/4381#discussion_r862346496


##########
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java:
##########
@@ -1971,27 +2002,7 @@ public void run() {
             continue;
           }
           this.activeProcedure = proc;
-          int activeCount = activeExecutorCount.incrementAndGet();
-          int runningCount = store.setRunningProcedureCount(activeCount);
-          LOG.trace("Execute pid={} runningCount={}, activeCount={}", proc.getProcId(),
-            runningCount, activeCount);
-          executionStartTime.set(EnvironmentEdgeManager.currentTime());
-          IdLock.Entry lockEntry = procExecutionLock.getLockEntry(proc.getProcId());
-          try {
-            executeProcedure(proc);
-          } catch (AssertionError e) {
-            LOG.info("ASSERT pid=" + proc.getProcId(), e);
-            throw e;
-          } finally {
-            procExecutionLock.releaseLockEntry(lockEntry);
-            activeCount = activeExecutorCount.decrementAndGet();
-            runningCount = store.setRunningProcedureCount(activeCount);
-            LOG.trace("Halt pid={} runningCount={}, activeCount={}", proc.getProcId(),
-              runningCount, activeCount);
-            this.activeProcedure = null;
-            lastUpdate = EnvironmentEdgeManager.currentTime();
-            executionStartTime.set(Long.MAX_VALUE);
-          }
+          lastUpdate = TraceUtil.trace(this::runProcedure, new ProcedureSpanBuilder(proc));

Review Comment:
   In a procedure's whole life time, it could reach here multiple times. For example, if it schedules some sub procedures, it will suspend itself for a while until all the sub procedures are finished, it will recover the execution. So I think if we want to trace procedure execution, we need to discuss more, and better to have a design doc first. It is not very straight forward, as how to define the relationship between parent procedure and sub procedure?



-- 
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@hbase.apache.org

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