brandboat commented on code in PR #21396:
URL: https://github.com/apache/kafka/pull/21396#discussion_r2777718294


##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:
##########
@@ -879,15 +880,23 @@ private void maybeFlushCurrentBatch(long currentTimeMs) {
             }
         }
 
+        private void failCurrentBatch(Throwable t) {
+            failCurrentBatch(t, true);
+        }
+
+        private void failCurrentBatchWithoutRelease(Throwable t) {
+            failCurrentBatch(t, false);
+        }
+
         /**
          * Fails the current batch, reverts to the snapshot to the base/start 
offset of the
          * batch, fails all the associated events.
          */
-        private void failCurrentBatch(Throwable t) {
+        private void failCurrentBatch(Throwable t, boolean freeCurrentBatch) {
             if (currentBatch != null) {
                 coordinator.revertLastWrittenOffset(currentBatch.baseOffset);
                 currentBatch.deferredEvents.complete(t);
-                freeCurrentBatch();
+                if (freeCurrentBatch) freeCurrentBatch();

Review Comment:
   @squah-confluent, thanks, it's already there: 
https://github.com/apache/kafka/blob/4.2/coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java#L485



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to