mjsax commented on a change in pull request #9368:
URL: https://github.com/apache/kafka/pull/9368#discussion_r501307743



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java
##########
@@ -625,11 +670,16 @@ private void restoreChangelog(final ChangelogMetadata 
changelogMetadata) {
                     
partitions.stream().collect(Collectors.toMap(Function.identity(), tp -> 
OffsetSpec.latest())),
                     new ListOffsetsOptions(IsolationLevel.READ_UNCOMMITTED)
             );
-            return result.all().get().entrySet().stream().collect(
-                    Collectors.toMap(Map.Entry::getKey, entry -> 
entry.getValue().offset()));
-        } catch (final TimeoutException | InterruptedException | 
ExecutionException e) {
-            // if timeout exception gets thrown we just give up this time and 
retry in the next run loop
+
+            final Map<TopicPartition,  
ListOffsetsResult.ListOffsetsResultInfo> resultPerPartition = 
result.all().get();
+            clearTaskTimeout(getTasksFromPartitions(tasks, partitions));
+
+            return resultPerPartition.entrySet().stream().collect(
+                    Collectors.toMap(Map.Entry::getKey, entry -> 
entry.getValue().offset())
+            );
+        } catch (final TimeoutException | InterruptedException | 
ExecutionException retriableException) {
             log.debug("Could not fetch all end offsets for {}, will retry in 
the next run loop", partitions);
+            maybeInitTaskTimeoutOrThrow(getTasksFromPartitions(tasks, 
partitions), retriableException);

Review comment:
       Here, we could also get different exceptions in addition to 
`TimeoutException` that we should just handle in the same way?
   
   Not sure about `InterruptedException`? Should this ever be thrown? Would it 
indicate a bug and we should just die?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to