[ 
https://issues.apache.org/jira/browse/KAFKA-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13774684#comment-13774684
 ] 

Jay Kreps commented on KAFKA-1008:
----------------------------------

Sriram had the same comment. It is possible to reason that the existing ways 
the method is used don't need synchronization but I don't think the method is 
thread safe since it depends on both size and mmap both of which can change (so 
e.g. mmap could be null and a truncate call could theoretically interleave with 
this call). I don't think it is very safe to have methods whose correctness 
depends on the existing call pattern. The synchronization doesn't hurt, in any 
case since this is not in any critical read or write path.
                
> 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: KAFKA-0.8-1008-v7.patch, KAFKA-0.8-1008-v8.patch, 
> KAFKA-1008-v6.patch, KAFKA-trunk-1008-v7.patch, unmap-v5.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

Reply via email to