Skip to content

KAFKA-13630: Reduce deque lock scope in RecordAccumulator.drainBatchesForOneNode#21665

Open
nileshkumar3 wants to merge 1 commit intoapache:trunkfrom
nileshkumar3:KAFKA-13630-recordaccumulator-locks
Open

KAFKA-13630: Reduce deque lock scope in RecordAccumulator.drainBatchesForOneNode#21665
nileshkumar3 wants to merge 1 commit intoapache:trunkfrom
nileshkumar3:KAFKA-13630-recordaccumulator-locks

Conversation

@nileshkumar3
Copy link

This PR reduces lock hold time in RecordAccumulator.drainBatchesForOneNode by moving transactional producer state updates outside the synchronized deque block after the batch is removed.
The change keeps only deque-dependent checks and pollFirst() under the lock, which helps reduce producer-side contention without changing the existing drain logic.

@github-actions github-actions bot added triage PRs from the community producer clients small Small PRs labels Mar 7, 2026
@nileshkumar3
Copy link
Author

@jasonk000 Can you review this

@nileshkumar3
Copy link
Author

@showuon can you please approve this.

@jasonk000
Copy link
Contributor

jasonk000 commented Mar 7, 2026

@nileshkumar3

I'm not a kafka committer nor familiar with this code anymore (it seems to have changed a lot since my last change to this code in 2022). thx.

@nileshkumar3
Copy link
Author

@lucasbru Can you please review this

@nileshkumar3
Copy link
Author

@yuyang08 Can you please review this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients producer small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants