dnadolny commented on PR #21065:
URL: https://github.com/apache/kafka/pull/21065#issuecomment-3711930709

   @junrao @chia7712 I've redone the approach with what you both suggested 
above. A couple notes:
    - I've kept the test I wrote `testNoBufferReuseWhenBatchHasTimeoutErrors` 
which continues to work unmodified with the new approach but otherwise removed 
the deallocateWithoutReuse code
    - RecordAccumulator's `incomplete` set wants to enforce that we only call 
remove at most once, so in the new else clause in completeBatch/failBatch where 
we now attempt to deallocate the batch we can't just blindly call the 
deallocate method, we need a new one that only does deallocation (if it hasn't 
already been done, checking the AtomicBoolean first) and doesn't attempt to 
remove it from the `incomplete` set


-- 
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