umustafi commented on code in PR #3982:
URL: https://github.com/apache/gobblin/pull/3982#discussion_r1645197903


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/MysqlMultiActiveLeaseArbiter.java:
##########
@@ -254,7 +256,8 @@ public LeaseAttemptStatus 
tryAcquireLease(DagActionStore.DagActionLeaseObject da
         log.debug("tryAcquireLease for [{}, is; {}, eventTimestamp: {}] - CASE 
1: no existing row for this dag action,"
             + " then go ahead and insert", dagActionLeaseObject.getDagAction(),
             dagActionLeaseObject.isReminder() ? "reminder" : "original", 
dagActionLeaseObject.getEventTimeMillis());
-        int numRowsUpdated = 
attemptLeaseIfNewRow(dagActionLeaseObject.getDagAction());
+        int numRowsUpdated = 
attemptLeaseIfNewRow(dagActionLeaseObject.getDagAction(),
+            
ExponentialBackoff.builder().maxRetries(3).initialDelay(10L).build());

Review Comment:
   this object is re-used so it needs to be recreated every time it's called



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/MysqlMultiActiveLeaseArbiter.java:
##########
@@ -254,7 +256,8 @@ public LeaseAttemptStatus 
tryAcquireLease(DagActionStore.DagActionLeaseObject da
         log.debug("tryAcquireLease for [{}, is; {}, eventTimestamp: {}] - CASE 
1: no existing row for this dag action,"
             + " then go ahead and insert", dagActionLeaseObject.getDagAction(),
             dagActionLeaseObject.isReminder() ? "reminder" : "original", 
dagActionLeaseObject.getEventTimeMillis());
-        int numRowsUpdated = 
attemptLeaseIfNewRow(dagActionLeaseObject.getDagAction());
+        int numRowsUpdated = 
attemptLeaseIfNewRow(dagActionLeaseObject.getDagAction(),
+            
ExponentialBackoff.builder().maxRetries(3).initialDelay(10L).build());

Review Comment:
   I set defaults for the static variable but I do actually want it to function 
as jitter for retrying a deadlock exception so I added some randomness to the 
initial delay. There may be other exceptions we want larger delay for, what do 
you think as (30,60ms) for the value?



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