cadonna commented on code in PR #12137:
URL: https://github.com/apache/kafka/pull/12137#discussion_r870087244


##########
streams/src/main/java/org/apache/kafka/streams/errors/StreamsException.java:
##########
@@ -66,10 +80,15 @@ public StreamsException(final Throwable throwable, final 
TaskId taskId) {
      *          guarantee that the exception wasn't directly related to a 
specific task.
      */
     public Optional<TaskId> taskId() {
-        return Optional.ofNullable(taskId);
+        return taskIds.isEmpty() ? Optional.empty() : Optional.ofNullable(new 
ArrayList<>(taskIds).get(0));
     }
 
     public void setTaskId(final TaskId taskId) {
-        this.taskId = taskId;
+        taskIds.clear();

Review Comment:
   I need to clear the tasks IDs otherwise you might not be able to get the 
task ID with `taskId()` after the first call to `setTaskId()`.



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