You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/12/15 22:33:41 UTC

[GitHub] [kafka] yyu1993 opened a new pull request #11605: MINOR: replace lastOption call in LocalLog#flush() to prevent NoSuchElementException

yyu1993 opened a new pull request #11605:
URL: https://github.com/apache/kafka/pull/11605


   This PR fixed the iterator access issue during segment flush where a NoSuchElementException may be thrown. This can particularly happen if the Iterable[LogSegment] is accessed by 2 threads in parallel. A particular case is when retention periodic work empties segments from the segments map, while concurrently the async flush operation tries to access the very last segment from the same map. Since Iterable[T].lastOption is not thread-safe, the parallel access sometimes fails with a NoSuchElementException.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] junrao merged pull request #11605: MINOR: replace lastOption call in LocalLog#flush() to prevent NoSuchElementException

Posted by GitBox <gi...@apache.org>.
junrao merged pull request #11605:
URL: https://github.com/apache/kafka/pull/11605


   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] kowshik commented on pull request #11605: MINOR: replace lastOption call in LocalLog#flush() to prevent NoSuchElementException

Posted by GitBox <gi...@apache.org>.
kowshik commented on pull request #11605:
URL: https://github.com/apache/kafka/pull/11605#issuecomment-996266315


   cc @junrao 


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org