aliehsaeedii commented on code in PR #17116:
URL: https://github.com/apache/kafka/pull/17116#discussion_r1760719974


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StateManagerUtil.java:
##########
@@ -93,21 +93,24 @@ static void registerStateStores(final Logger log,
         }
 
         final TaskId id = stateMgr.taskId();
-        if (!stateDirectory.lock(id)) {
+        if (!stateDirectory.canTryLock(id, System.currentTimeMillis())) {
+            log.trace("Task {} is still not allowed to retry acquiring the 
state directory lock", id);

Review Comment:
   @cadonna @lucasbru Could `StateManagerUtil.registerStateStores()` return a 
boolean instead of void? This can solve the issue, otherwise, if we throw an 
exception in the case of `stateDirectory.canTryLock() = false,` what would be 
the benefit of having backoff-retry for the lock? However this is not a simple 
small change. I assume we need to change many methods then.



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