fix: Detection of the `READY`-state for `InfoChannel` was flawed
authorKai Moritz <kai@juplo.de>
Tue, 5 Mar 2024 16:50:47 +0000 (17:50 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 14 Mar 2024 08:11:21 +0000 (09:11 +0100)
src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/InfoChannel.java

index 7665fae..95f7fb0 100644 (file)
@@ -225,9 +225,10 @@ public class InfoChannel implements Channel
     {
       boolean loadInProgress = IntStream
           .range(0, numShards)
-          .anyMatch(shard -> this.nextOffset[shard] < currentOffset[partition]);
+          .anyMatch(shard -> this.nextOffset[shard] < currentOffset[shard]);
       if (!loadInProgress)
       {
+        log.info("Loading of info completed! Resuming normal operations...");
         channelState = ChannelState.READY;
       }
     }