abbccdda commented on a change in pull request #9800: URL: https://github.com/apache/kafka/pull/9800#discussion_r551462812
########## File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java ########## @@ -633,6 +636,10 @@ public boolean isProcessable(final long wallClockTime) { return false; } + if (hasPendingTransaction) { Review comment: Could we add a comment here to explain why a task is not processable under pending transaction? ########## File path: streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java ########## @@ -408,9 +417,74 @@ public void shouldProcessInOrder() { assertEquals(3, source2.numReceived); } + @Test + public void shouldProcessRecordsAfterPrepareCommitWhenEosDisabled() { + task = createStatelessTask(createConfig(), StreamsConfig.METRICS_LATEST); + + assertFalse(task.process(time.milliseconds())); + + task.addRecords(partition1, asList( + getConsumerRecord(partition1, 10), + getConsumerRecord(partition1, 20), + getConsumerRecord(partition1, 30) + )); + + assertTrue(task.process(time.milliseconds())); + task.prepareCommit(); + assertTrue(task.process(time.milliseconds())); + task.postCommit(false); + assertTrue(task.process(time.milliseconds())); + + assertFalse(task.process(time.milliseconds())); + } + + @Test + public void shouldNotProcessRecordsAfterPrepareCommitWhenEosAlphaEnabled() { + task = createStatelessTask(createConfig(StreamsConfig.EXACTLY_ONCE, "0"), StreamsConfig.METRICS_LATEST); + + assertFalse(task.process(time.milliseconds())); + + task.addRecords(partition1, asList( + getConsumerRecord(partition1, 10), + getConsumerRecord(partition1, 20), + getConsumerRecord(partition1, 30) + )); + + assertTrue(task.process(time.milliseconds())); + task.prepareCommit(); + assertFalse(task.process(time.milliseconds())); + task.postCommit(false); + assertTrue(task.process(time.milliseconds())); + assertTrue(task.process(time.milliseconds())); Review comment: Why do we need to assert twice? ########## File path: streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java ########## @@ -408,9 +417,74 @@ public void shouldProcessInOrder() { assertEquals(3, source2.numReceived); } + @Test + public void shouldProcessRecordsAfterPrepareCommitWhenEosDisabled() { + task = createStatelessTask(createConfig(), StreamsConfig.METRICS_LATEST); Review comment: nit: we may extract the common test logic to be reused by all 3 process record tests. ---------------------------------------------------------------- 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