kafka
kafka copied to clipboard
Kafka-16355: Fix ConcurrentModificationException in evictWhile Method
This PR addresses an issue with the evictWhile method where a ConcurrentModificationException was being thrown due to modifications made to sortedMap during iteration. The following changes have been made:
- Safe Iteration: The method now iterates over a copied list of entries from sortedMap, ensuring that modifications to sortedMap do not interfere with the iteration process.
- Consistent Removal: Entries are safely removed from sortedMap during the iteration without causing a ConcurrentModificationException
Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.
If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).
If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.
@abhi-ksolves Thanks for the fix.
For a more optimized implementation, could we create a list of to be deleted BufferKeys and remove them from the sortedMap after the loop?
@abhi-ksolves -- What is the status of this PR? Are you still interested to finish it?
@abhi-ksolves -- Any updates?
Hi @mjsax Sorry for the delay; I got involved in a lot of things.
Will start to review this soon.
Hi @mjsax Following up for review.
This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.
If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).
If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.