mjsax commented on code in PR #20693:
URL: https://github.com/apache/kafka/pull/20693#discussion_r2501356226


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskExecutionMetadata.java:
##########
@@ -63,16 +68,52 @@ public ProcessingMode processingMode() {
 
     public boolean canProcessTask(final Task task, final long now) {
         final String topologyName = task.id().topologyName();
+        final boolean taskWasReady = 
!taskToLastNotReadyLogTime.containsKey(task.id());
+        final boolean canProcess;
+        final String logMessage;
+        
         if (!hasNamedTopologies) {
             // TODO implement error handling/backoff for non-named topologies 
(needs KIP)
-            return !pausedTopologies.contains(UNNAMED_TOPOLOGY);
+            logMessage = String.format("Task %s processing check for unnamed 
topology '%s'", task.id(), topologyName);

Review Comment:
   But I am wondering if we would want to just use `Task %s can't be processed: 
topology is paused` -- similar to the "name topology code below?
   
   In the end, we are preparing an error message, which we only use if we are 
not "ready" for processing, so we only need the "negative" one?



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskExecutionMetadata.java:
##########
@@ -63,16 +68,52 @@ public ProcessingMode processingMode() {
 
     public boolean canProcessTask(final Task task, final long now) {
         final String topologyName = task.id().topologyName();
+        final boolean taskWasReady = 
!taskToLastNotReadyLogTime.containsKey(task.id());
+        final boolean canProcess;
+        final String logMessage;
+        
         if (!hasNamedTopologies) {
             // TODO implement error handling/backoff for non-named topologies 
(needs KIP)
-            return !pausedTopologies.contains(UNNAMED_TOPOLOGY);
+            logMessage = String.format("Task %s processing check for unnamed 
topology '%s'", task.id(), topologyName);
+            canProcess = !pausedTopologies.contains(UNNAMED_TOPOLOGY);
         } else {
             if (pausedTopologies.contains(topologyName)) {
-                return false;
+                canProcess = false;
+                logMessage = String.format("Task %s can't be processed: 
topology '%s' is paused", task.id(), topologyName);
             } else {
+                logMessage = String.format("Task %s processing check for named 
topology '%s'", task.id(), topologyName);

Review Comment:
   Not sure if we need this error message? At this point, we don' know yet, if 
we can or cannot process, as we compute this only below via `canProcess = 
metadata == null || (metadata.canProcess() && metadata.canProcessTask(task, 
now));`.
   
   But we would use the error message only if `canProcess` is set to `false`, 
so should we not just reuse `                logMessage = String.format("Task 
%s can't be processed: topology '%s' is paused", task.id(), topologyName);` 
from above?



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