You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "showuon (via GitHub)" <gi...@apache.org> on 2023/04/06 10:01:27 UTC

[GitHub] [kafka] showuon commented on a diff in pull request #13512: MINOR: fix stream failing tests

showuon commented on code in PR #13512:
URL: https://github.com/apache/kafka/pull/13512#discussion_r1159573303


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java:
##########
@@ -644,14 +644,15 @@ private int restoreChangelog(final Task task, final ChangelogMetadata changelogM
         final int numRecords = changelogMetadata.bufferedLimitIndex;
 
         if (numRecords != 0) {
-            final List<ConsumerRecord<byte[], byte[]>> records = changelogMetadata.bufferedRecords.subList(0, numRecords);
+            final List<ConsumerRecord<byte[], byte[]>> records = new ArrayList<>(changelogMetadata.bufferedRecords.subList(0, numRecords));

Review Comment:
   We'll get concurrent modification for the list exception in L660 `records.size()`. Fixing it by creating a clone of the list, and remove all from the `bufferedRecords` below. We can optimize it later. 



-- 
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: jira-unsubscribe@kafka.apache.org

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