[ https://issues.apache.org/jira/browse/KAFKA-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13739105#comment-13739105 ]
Elizabeth Wei commented on KAFKA-1008: -------------------------------------- Thanks for the feedback! 1 - Currently tryUnmap does a type checking. If the super class of "m" is changed in the future, the type check will be false, and there will be no casting errors like ClassNotFoundException at runtime. 2 - I removed the flush(). I probably used an older copy a couple of weeks ago. 3 - Reading through the bug report, I'm not sure if the cases matter in terms of Kafka - I think all the threads in a Kafka process should be trusted and the race condition between the unmap/remap shouldn't happen if coded properly. I noticed that in the most recent version, the resize method is synchronized, which should prevent multiple threads trying to resize/unmap the files. > Unmap before resizing > --------------------- > > Key: KAFKA-1008 > URL: https://issues.apache.org/jira/browse/KAFKA-1008 > Project: Kafka > Issue Type: Bug > Components: core, log > Affects Versions: 0.8 > Environment: Windows, Linux, Mac OS > Reporter: Elizabeth Wei > Assignee: Jay Kreps > Labels: patch > Fix For: 0.8 > > Attachments: unmap-v2.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > While I was studying how MappedByteBuffer works, I saw a sharing runtime > exception on Windows. I applied what I learned to generate a patch which uses > an internal open JDK API to solve this problem. > Following Jay's advice, I made a helper method called tryUnmap(). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira