Merge pull request #11850 from rmuir/enable_j9

allow IBM J9 2.8+ in version check
This commit is contained in:
Robert Muir 2015-06-24 11:36:15 -04:00
commit b00be9fe4a
1 changed files with 18 additions and 7 deletions

View File

@ -122,13 +122,24 @@ final class JVMCheck {
}
}
} else if ("IBM Corporation".equals(Constants.JVM_VENDOR)) {
// currently any JVM from IBM will easily result in index corruption.
StringBuilder sb = new StringBuilder();
sb.append("IBM runtimes suffer from several bugs which can cause data corruption.");
sb.append(System.lineSeparator());
sb.append("Please upgrade the JVM, see ").append(JVM_RECOMMENDATIONS);
sb.append(" for current recommendations.");
throw new RuntimeException(sb.toString());
// currently some old JVM versions from IBM will easily result in index corruption.
// 2.8+ seems ok for ES from testing.
float version = Float.POSITIVE_INFINITY;
try {
version = Float.parseFloat(Constants.JVM_VERSION);
} catch (NumberFormatException ignored) {
// this is just a simple best-effort to detect old runtimes,
// if we cannot parse it, we don't fail.
}
if (version < 2.8f) {
StringBuilder sb = new StringBuilder();
sb.append("IBM J9 runtimes < 2.8 suffer from several bugs which can cause data corruption.");
sb.append(System.lineSeparator());
sb.append("Your version: " + Constants.JVM_VERSION);
sb.append(System.lineSeparator());
sb.append("Please upgrade the JVM to a recent IBM JDK");
throw new RuntimeException(sb.toString());
}
}
}
}