hachikuji commented on a change in pull request #8782: URL: https://github.com/apache/kafka/pull/8782#discussion_r434218326
########## File path: core/src/test/scala/unit/kafka/coordinator/transaction/TransactionMarkerChannelManagerTest.scala ########## @@ -86,6 +90,70 @@ class TransactionMarkerChannelManagerTest { .anyTimes() } + @Test + def shouldOnlyWriteTxnCompletionOnce(): Unit = { Review comment: It does. I was trying to setup this test to fit how we're likely hitting this in practice. In the call to `addTxnMarkersToSend`, before calling `maybeWriteTxnCompletion`, we have to acquire the lock. It is possible that the caller fails to acquire the lock before the markers finish getting written and the transaction gets completed in the request completion handler. ---------------------------------------------------------------- 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