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


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/MysqlMultiActiveLeaseArbiter.java:
##########
@@ -489,78 +492,81 @@ protected static SelectInfoResult 
createSelectInfoResult(ResultSet resultSet) th
    * @throws IOException
    */
   protected LeaseAttemptStatus evaluateStatusAfterLeaseAttempt(int 
numRowsUpdated,
-      DagActionStore.DagAction flowAction, Optional<Timestamp> 
dbCurrentTimestamp, boolean isReminderEvent,
+      DagActionStore.DagAction dagAction, Optional<Timestamp> 
dbCurrentTimestamp, boolean isReminderEvent,
       boolean adoptConsensusFlowExecutionId)
       throws SQLException, IOException {
     // Fetch values in row after attempted insert
-    SelectInfoResult selectInfoResult = getRowInfo(flowAction);
+    SelectInfoResult selectInfoResult = getRowInfo(dagAction);
     // Another participant won the lease in between
     if (!selectInfoResult.getLeaseAcquisitionTimeMillis().isPresent()) {
       return new NoLongerLeasingStatus();
     }
-    DagActionStore.DagAction updatedFlowAction =
-        adoptConsensusFlowExecutionId ? 
flowAction.updateFlowExecutionId(selectInfoResult.eventTimeMillis) : flowAction;
+    DagActionStore.DagAction updatedDagAction =
+        adoptConsensusFlowExecutionId ? 
dagAction.updateFlowExecutionId(selectInfoResult.eventTimeMillis) : dagAction;
+    long minimumLingerDurationMillis = 
selectInfoResult.getLeaseAcquisitionTimeMillis().get() + 
selectInfoResult.getDbLinger()
+        - (dbCurrentTimestamp.isPresent() ? dbCurrentTimestamp.get().getTime() 
: System.currentTimeMillis());

Review Comment:
   likely not major, but strictly speaking, best would be to use the DB 
function `CURRENT_TIMESTAMP` (by adding to the query returning these results).  
otherwise we're using the DB time for most things, but still mixing in the 
host's own system time here



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