devabhishekpal commented on code in PR #7517:
URL: https://github.com/apache/ozone/pull/7517#discussion_r1870603029


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconScmTask.java:
##########
@@ -88,8 +94,12 @@ public boolean isRunning() {
   }
 
   protected void recordSingleRunCompletion() {
-    reconTaskStatusDao.update(new ReconTaskStatus(getTaskName(),
-        System.currentTimeMillis(), 0L));
+    taskStatusCounter.updateCounter(getTaskName(), true);
+    synchronized (this) {
+      
reconTaskStatusRecord.setLastUpdatedTimestamp(System.currentTimeMillis());
+      reconTaskStatusRecord.setLastTaskRunStatus(1);

Review Comment:
   But since we are using an INTEGER value, we do not have any indication of if 
the last task run was ever completed.
   If the initialization is done using 0 then the result might give us false 
indication that the task had run even in the scenario where the task had not at 
all run.
   
   So there should be another value with which we can initialize to indicate 
the task has not yet run (say in case Recon first comes up, and for some reason 
the task is not running even for the first time)
   
   In the current code:
   0 -> Equivalent to NULL, means no last task was run, we do not know status
   1 -> Last task has passed
   -1 -> Last task has failed



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to