lucasbru commented on code in PR #17116:
URL: https://github.com/apache/kafka/pull/17116#discussion_r1760738049
##########
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:
It could be easier to move all the back-off logic to `TaskManager`. Before
attempting to initialize in `addTaskToStateUpdater`, check `canTryLock`. If we
catch a `LockException`, create the backoffRecord. Just an idea which maybe
would not require changing many methods.
--
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]