phet commented on code in PR #3899:
URL: https://github.com/apache/gobblin/pull/3899#discussion_r1543717165


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagementTaskStreamImpl.java:
##########
@@ -84,19 +116,12 @@ public boolean hasNext() {
 
   @Override
   public DagTask next() {
-    /*TODO: this requires use of lease arbiter, in single-active execution 
lease arbiter will not be present and we can
-     provide a dummy LeaseObtainedStatus or create alternate route
-    */
-    if (!this.reminderSettingDagProcLeaseArbiter.isPresent()) {
-      throw new RuntimeException("DagManagement not initialized in 
multi-active execution mode when required.");
-    }
     try {
       LeaseAttemptStatus leaseAttemptStatus = null;
       DagActionStore.DagAction dagAction = null;
       while (!(leaseAttemptStatus instanceof 
LeaseAttemptStatus.LeaseObtainedStatus)) {
         dagAction = this.dagActionQueue.take();  //`take` blocks till element 
is not available
-        // TODO: need to handle reminder events and flag them
-        leaseAttemptStatus = 
this.reminderSettingDagProcLeaseArbiter.get().tryAcquireLease(dagAction, 
System.currentTimeMillis(), false, false);
+        leaseAttemptStatus = retrieveLeaseStatus(dagAction);
       }
       return createDagTask(dagAction, (LeaseAttemptStatus.LeaseObtainedStatus) 
leaseAttemptStatus);

Review Comment:
   nit: to me this reads more clearly:
   ```
   while (true) {
       DagActionStore.DagAction dagAction = this.dagActionQueue.take();  // 
blocks until element available
       LeaseAttemptStatus leaseAttemptStatus = retrieveLeaseStatus(dagAction);
       if (leaseAttemptStatus instanceof 
LeaseAttemptStatus.LeaseObtainedStatus) {
           return createDagTask(dagAction, 
(LeaseAttemptStatus.LeaseObtainedStatus) leaseAttemptStatus);
       }
   }
   ```
   
   whatever you choose, note this is incorrect:
   ```
   //`take` blocks till element is not available
   ```



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