GitHub user mpoindexter opened a pull request:
https://github.com/apache/kafka/pull/154
KAFKA-2170, KAFKA-1194: Fixes for Windows
This branch fixes several Windows specific issues, both in the code and in
the tests. With these changes the whole test suite passes on my Windows
machine. I found the following issues that were relevant in Jira: KAFKA-2170
and KAFKA-1194, but there may be some others. I also have a branch with these
changes done against 0.8.2.1 if there's any interest in merging to the 0.8
series.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mpoindexter/kafka fix-windows
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/154.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #154
----
commit 19ae8ac6a4c8ceef6451635055f75bd038fe25ae
Author: Mike Poindexter <[email protected]>
Date: 2015-08-20T02:01:25Z
Fix Windows failures when renaming/deleting files
- Windows will not allow a file that is mmap'd to be renamed or
deleted. To work around this ensure that forceUnmap is called
on close, delete and rename. For the rename case, make sure that
the file is reopened after the rename completes
- Windows will not allow a file that has an open FileChannel to be
renamed. This causes breakage in FileMessageSet.renameTo since
it holds the FileChannel open during rename. This can be worked
around by changing how we open the FileChannel to use
FileChannel.open instead of new FileInputStream(file).toChannel.
This causes the file to be opened with the FILE_SHARE_DELETE flag
which will allow the file to be renamed while open. See this JDK
bug for details: http://bugs.java.com/view_bug.do?bug_id=6357433
- Fix a bug in LogTest that caused a race between the next iteration
of a test loop and the asynchronous delete of old segments
- Fix a bug in LogTest where the log was not closed leading to leftover
garbage at the next run of a test loop
- Ensure that any time forceUnmap is called we set mmap to null. This
will ensure that invalid use after forceUnmap causes a NPE instead of
JVM memory corruption
commit 2066306285738d42be74c7987ee0ef91b8a6d7ee
Author: Mike Poindexter <[email protected]>
Date: 2015-08-20T22:26:14Z
Fixes for load cleaning tests to ensure the files
in a segment are only open once so renames, etc.
do not fail on windows
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---