kafka icon indicating copy to clipboard operation
kafka copied to clipboard

Kafka-16355: Fix ConcurrentModificationException in evictWhile Method

Open abhi-ksolves opened this issue 1 year ago • 5 comments

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)

abhi-ksolves avatar Jul 09 '24 12:07 abhi-ksolves

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.

github-actions[bot] avatar Jan 06 '25 03:01 github-actions[bot]

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

aliehsaeedii avatar Jan 28 '25 16:01 aliehsaeedii

@abhi-ksolves -- What is the status of this PR? Are you still interested to finish it?

mjsax avatar Apr 05 '25 00:04 mjsax

@abhi-ksolves -- Any updates?

mjsax avatar Jun 11 '25 21:06 mjsax

Hi @mjsax Sorry for the delay; I got involved in a lot of things.

Will start to review this soon.

abhi-ksolves avatar Jun 13 '25 09:06 abhi-ksolves

Hi @mjsax Following up for review.

abhi-ksolves avatar Jun 24 '25 06:06 abhi-ksolves

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.

github-actions[bot] avatar Sep 26 '25 03:09 github-actions[bot]