-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable unmap hack for java 9 #16986
Enable unmap hack for java 9 #16986
Conversation
Looks good. |
+1, thanks @rmuir. It's important we can run under Java 9 ea even if recent builds have been badly broken... |
@@ -109,7 +109,12 @@ private void createStaleReplicaScenario() throws Exception { | |||
logger.info("--> check that old primary shard does not get promoted to primary again"); | |||
// kick reroute and wait for all shard states to be fetched | |||
client(master).admin().cluster().prepareReroute().get(); | |||
assertBusy(() -> assertThat(internalCluster().getInstance(GatewayAllocator.class, master).getNumberOfInFlightFetch(), equalTo(0))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this change wanted, it looks unrelated to this issue?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned in the issue, it will not compile with java 9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. That seems to be a bug in javac :-) Maybe we should open issue!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have tried:
assertBusy(() -> {
assertThat(internalCluster().getInstance(GatewayAllocator.class, master).getNumberOfInFlightFetch(), equalTo(0));
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it the obvious fix without any special sugar. and plenty of assertBusy's, actually most of them, are written this way.
again, as it was a compiler failure, the style is unimportant to me really. More important was to get mmap working :)
This mechanism changed for java 9: requires a "fake" permission of
accessClassInPackage.jdk.internal.ref
Currently unmapping will not work with java 9 unless we make changes:
See https://issues.apache.org/jira/browse/LUCENE-6989 for more information.
I also had to upgrade my gradle to the latest to work at all with java 9, and fix a test so the source code compiles at all. I only ran this small unit test because hotspot on java 9 has been broken for a long time.