Skip to content

Upgrade/jdk 11 ci #31356

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

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
060e00a
Move to Gradle 4.8 RC1
alpar-t May 18, 2018
26f0d17
Use latest version of plugin
alpar-t May 18, 2018
1011582
Switch to Gradle GA
alpar-t Jun 11, 2018
5445055
Add and configure build compare plugin
alpar-t Jun 11, 2018
c7338af
add work-around for https://github.com/gradle/gradle/issues/5692
alpar-t Jun 11, 2018
ab67b25
work around https://github.com/gradle/gradle/issues/5696
alpar-t Jun 12, 2018
2e8cb7e
Make use of Gradle build compare with reference project
alpar-t Jun 12, 2018
3a2e7bf
Merge commit 'a178290' into upgrade/gradle_4.8
alpar-t Jun 12, 2018
eec1f43
Make the manifest more compare friendly
alpar-t Jun 12, 2018
d0f7e94
Clear the manifest in compare friendly mode
alpar-t Jun 12, 2018
3f5840a
Remove animalsniffer from buildscript classpath
alpar-t Jun 12, 2018
d7c4d17
Fix javadoc errors
alpar-t Jun 12, 2018
f2c39ea
Upgrade bouncycastle
alpar-t Jun 12, 2018
919e404
Fix doc issues
alpar-t Jun 13, 2018
c3bc727
Downgrade bouncycastle to avoid invalid manifest
alpar-t Jun 13, 2018
2afe038
Add checksum for new jars
alpar-t Jun 13, 2018
0807e7d
Update tika permissions for jdk 11
alpar-t Jun 13, 2018
d39e573
Mute test failing on jdk 11
alpar-t Jun 13, 2018
e7715c5
Work around wird Security bootstrap issue
alpar-t Jun 14, 2018
89590fb
reference Gradle issues in comments
alpar-t Jun 14, 2018
c406996
Conditionally configure build compare
alpar-t Jun 14, 2018
7de976b
Merge commit 'fcf1e41' into upgrade/jdk_11
alpar-t Jun 15, 2018
09c92de
Merge commit 'fcf1e41' into upgrade/gradle_4.8
alpar-t Jun 15, 2018
7523a22
Merge branch 'upgrade/gradle_4.8' into upgrade/jdk_11
alpar-t Jun 15, 2018
e1b579d
Extend security fix to versioned jars
alpar-t Jun 15, 2018
09f925b
Merge branch 'upgrade/gradle_4.8' into upgrade/jdk_11
alpar-t Jun 15, 2018
2f71509
fix equals check
alpar-t Jun 15, 2018
0d7f231
Merge branch 'upgrade/gradle_4.8' into upgrade/jdk_11
alpar-t Jun 15, 2018
1984486
Add JDK11 to CI
alpar-t Jun 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci/java-versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# build and test Elasticsearch for this branch. Valid Java versions
# are 'java' or 'openjdk' followed by the major release number.

ES_BUILD_JAVA=java10
ES_RUNTIME_JAVA=java8
ES_BUILD_JAVA=java11
ES_RUNTIME_JAVA=java11
1 change: 1 addition & 0 deletions .ci/matrix-build-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

ES_BUILD_JAVA:
- java10
- java11
1 change: 1 addition & 0 deletions .ci/matrix-runtime-javas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
ES_RUNTIME_JAVA:
- java8
- java10
- java11
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -575,3 +575,29 @@ gradle.projectsEvaluated {
}
}
}

apply plugin: 'compare-gradle-builds'

if (System.properties.get("build.compare") != null) {
compareGradleBuilds {
ext.referenceProject = System.properties.get("build.compare")
doFirst {
if (file(referenceProject).exists() == false) {
throw new GradleException(
"Use git worktree to check out a version to compare against to ../elasticsearch_build_reference"
)
}
}
sourceBuild {
gradleVersion = "4.7" // does not default to gradle weapper of project dir, but current version
projectDir = referenceProject
tasks = ["clean", "assemble"]
arguments = ["-Dbuild.compare_friendly=true"]
}
targetBuild {
tasks = ["clean", "assemble"]
// use -Dorg.gradle.java.home= to alter jdk versions
arguments = ["-Dbuild.compare_friendly=true"]
}
}
}
1 change: 0 additions & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ GradleVersion logVersion = GradleVersion.current() > GradleVersion.version('4.3'

dependencies {
compileOnly "org.gradle:gradle-logging:${logVersion.getVersion()}"
compile 'ru.vyarus:gradle-animalsniffer-plugin:1.2.0' // Gradle 2.14 requires a version > 1.0.1
}

/*****************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ class BuildPlugin implements Plugin<Project> {
// just a self contained test-fixture configuration, likely transitive and hellacious
return
}
configuration.resolutionStrategy.failOnVersionConflict()
configuration.resolutionStrategy {
failOnVersionConflict()
// work around https://github.com/gradle/gradle/issues/5692
preferProjectModules()
}
})

// force all dependencies added directly to compile/testCompile to be non-transitive, except for ES itself
Expand Down Expand Up @@ -475,13 +479,17 @@ class BuildPlugin implements Plugin<Project> {
}
}

project.tasks.withType(GenerateMavenPom.class) { GenerateMavenPom t ->
// place the pom next to the jar it is for
t.destination = new File(project.buildDir, "distributions/${project.archivesBaseName}-${project.version}.pom")
// build poms with assemble (if the assemble task exists)
Task assemble = project.tasks.findByName('assemble')
if (assemble) {
assemble.dependsOn(t)
// Work around Gradle 4.8 issue until we `enableFeaturePreview('STABLE_PUBLISHING')`
// https://github.com/gradle/gradle/issues/5696#issuecomment-396965185
project.getGradle().getTaskGraph().whenReady {
project.tasks.withType(GenerateMavenPom.class) { GenerateMavenPom t ->
// place the pom next to the jar it is for
t.destination = new File(project.buildDir, "distributions/${project.archivesBaseName}-${project.version}.pom")
// build poms with assemble (if the assemble task exists)
Task assemble = project.tasks.findByName('assemble')
if (assemble) {
assemble.dependsOn(t)
}
}
}
}
Expand Down Expand Up @@ -625,6 +633,10 @@ class BuildPlugin implements Plugin<Project> {
jarTask.manifest.attributes('Change': shortHash)
}
}
// Force manifest entries that change by nature to a constant to be able to compare builds more effectively
if (System.properties.getProperty("build.compare_friendly", "false") == "true") {
jarTask.manifest.getAttributes().clear()
}
}
// add license/notice files
project.afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,8 @@ public int compareTo(DeadNode rhs) {
}

/**
* Adapts an <code>Iterator<DeadNodeAndRevival></code> into an
* <code>Iterator<Node></code>.
* Adapts an <code>Iterator&lt;DeadNodeAndRevival&gt;</code> into an
* <code>Iterator&lt;Node&gt;</code>.
*/
private static class DeadNodeIteratorAdapter implements Iterator<Node> {
private final Iterator<DeadNode> itr;
Expand Down
2 changes: 1 addition & 1 deletion distribution/tools/plugin-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ archivesBaseName = 'elasticsearch-plugin-cli'
dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}"
compileOnly "org.elasticsearch:elasticsearch-cli:${version}"
compile "org.bouncycastle:bcpg-jdk15on:1.59"
compile "org.bouncycastle:bcpg-jdk15on:1.58"
compile "org.bouncycastle:bcprov-jdk15on:1.59"
testCompile "org.elasticsearch.test:framework:${version}"
testCompile 'com.google.jimfs:jimfs:1.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b92c863d75bbdbfa88f08301cb243f406a58bec4

This file was deleted.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
zipStoreBase=GRADLE_USER_HOME
distributionSha256Sum=203f4537da8b8075e38c036a6d14cb71b1149de5bf0a8f6db32ac2833a1d1294
zipStorePath=wrapper/dists
distributionSha256Sum=da9600da2a28a43f5f77364deecbb9b01c1ddb7d3ecafe1d5c93bcd8a8059ab1
2 changes: 1 addition & 1 deletion plugins/ingest-attachment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ esplugin {
versions << [
'tika': '1.17',
'pdfbox': '2.0.8',
'bouncycastle': '1.55',
'bouncycastle': '1.59',
'poi': '3.17',
'mime4j': '0.8.1'
]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
db389ade95f48592908a84e7050a691c8834723c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9cef0aab8a4bb849a8476c058ce3ff302aba3fff

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2507204241ab450456bdb8e8c0a8f986e418bd99
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,11 @@ static PermissionCollection getRestrictedPermissions() {
perms.add(new RuntimePermission("getClassLoader"));
// ZipFile needs accessDeclaredMembers on JDK 10; cf. https://bugs.openjdk.java.net/browse/JDK-8187485
if (JavaVersion.current().compareTo(JavaVersion.parse("10")) >= 0) {
/*
* See if this permission can be removed in JDK 11, bump the version here to 12 if not. If this permission can be removed, also
* remove the grant in the plugin-security.policy.
*/
assert JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0;
perms.add(new RuntimePermission("accessDeclaredMembers"));
if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) {
// TODO remove this and from plugin-security.policy when JDK 11 is the only one we support
// this is needed pre 11, but it's fixed in 11 : https://bugs.openjdk.java.net/browse/JDK-8187485
perms.add(new RuntimePermission("accessDeclaredMembers"));
}
}
perms.setReadOnly();
return perms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ private Map<String, Object> parseDocument(String file, AttachmentProcessor proce
return attachmentData;
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31305")
public void testIndexedChars() throws Exception {
processor = new AttachmentProcessor(randomAlphaOfLength(10), "source_field",
"target_field", EnumSet.allOf(AttachmentProcessor.Property.class), 19, false, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,16 @@ static Policy readPolicy(URL policyFile, Map<String, URL> codebases) {
if (aliasProperty.equals(property) == false) {
propertiesSet.add(aliasProperty);
String previous = System.setProperty(aliasProperty, url.toString());
if (previous != null) {
// allow to re-set to what was previously there. https://github.com/elastic/elasticsearch/issues/31324
if (previous != null && url.toString().equals(previous) == false) {
throw new IllegalStateException("codebase property already set: " + aliasProperty + " -> " + previous +
", cannot set to " + url.toString());
}
}
propertiesSet.add(property);
String previous = System.setProperty(property, url.toString());
if (previous != null) {
// allow to re-set to what was previously there. https://github.com/elastic/elasticsearch/issues/31324
if (previous != null && url.toString().equals(previous) == false) {
throw new IllegalStateException("codebase property already set: " + property + " -> " + previous +
", cannot set to " + url.toString());
}
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/org/elasticsearch/search/SearchHit.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ public XContentBuilder toInnerXContent(XContentBuilder builder, Params params) t
* This parser outputs a temporary map of the objects needed to create the
* SearchHit instead of directly creating the SearchHit. The reason for this
* is that this way we can reuse the parser when parsing xContent from
* {@link CompletionSuggestion.Entry.Option} which unfortunately inlines the
* output of
* {@link org.elasticsearch.search.suggest.completion.CompletionSuggestion.Entry.Option} which unfortunately inlines
* the output of
* {@link #toInnerXContent(XContentBuilder, org.elasticsearch.common.xcontent.ToXContent.Params)}
* of the included search hit. The output of the map is used to create the
* actual SearchHit instance via {@link #createFromMap(Map)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public void collect(int doc, long bucket) throws IOException {

/**
* Replay the documents that might contain a top bucket and pass top buckets to
* the {@link this#deferredCollectors}.
* the {@link #deferredCollectors}.
*/
private void runDeferredCollections() throws IOException {
final boolean needsScores = needsScores();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class CompositeValuesCollectorQueue implements Releasable {
*
* @param sources The list of {@link CompositeValuesSourceConfig} to build the composite buckets.
* @param size The number of composite buckets to keep.
* @param afterKey
* @param afterKey composite key
*/
CompositeValuesCollectorQueue(BigArrays bigArrays, SingleDimensionValuesSource<?>[] sources, int size, CompositeKey afterKey) {
this.bigArrays = bigArrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ abstract class SingleDimensionValuesSource<T extends Comparable<T>> implements R
* The current value is filled by a {@link LeafBucketCollector} that visits all the
* values of each document. This method saves this current value in a slot and should only be used
* in the context of a collection.
* See {@link this#getLeafCollector}.
* See {@link #getLeafCollector}.
*/
abstract void copyCurrent(int slot);

Expand All @@ -87,15 +87,15 @@ abstract class SingleDimensionValuesSource<T extends Comparable<T>> implements R
* The current value is filled by a {@link LeafBucketCollector} that visits all the
* values of each document. This method compares this current value with the value present in
* the provided slot and should only be used in the context of a collection.
* See {@link this#getLeafCollector}.
* See {@link #getLeafCollector}.
*/
abstract int compareCurrent(int slot);

/**
* The current value is filled by a {@link LeafBucketCollector} that visits all the
* values of each document. This method compares this current value with the after value
* set on this source and should only be used in the context of a collection.
* See {@link this#getLeafCollector}.
* See {@link #getLeafCollector}.
*/
abstract int compareCurrentWithAfter();

Expand All @@ -120,7 +120,7 @@ T getAfter() {
* Creates a {@link LeafBucketCollector} that extracts all values from a document and invokes
* {@link LeafBucketCollector#collect} on the provided <code>next</code> collector for each of them.
* The current value of this source is set on each call and can be accessed by <code>next</code> via
* the {@link this#copyCurrent(int)} and {@link this#compareCurrent(int)} methods. Note that these methods
* the {@link #copyCurrent(int)} and {@link #compareCurrent(int)} methods. Note that these methods
* are only valid when invoked from the {@link LeafBucketCollector} created in this source.
*/
abstract LeafBucketCollector getLeafCollector(LeafReaderContext context, LeafBucketCollector next) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ public void testEnsureNoSelfReferences() throws IOException {

/**
* Test that the same map written multiple times do not trigger the self-reference check in
* {@link CollectionUtils#ensureNoSelfReferences(Object)}
* {@link CollectionUtils#ensureNoSelfReferences(Object, String)} (Object)}
*/
public void testRepeatedMapsAndNoSelfReferences() throws Exception {
Map<String, Object> mapB = singletonMap("b", "B");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

/**
* Mappings. Mappings define the way that documents should be translated to
* Lucene indices, for instance how the
* {@link org.elasticsearch.index.mapper.UidFieldMapper document identifier}
* should be indexed, whether a string field should be indexed as a
* Lucene indices, for instance whether a string field should be indexed as a
* {@link org.elasticsearch.index.mapper.TextFieldMapper text} or
* {@link org.elasticsearch.index.mapper.KeywordFieldMapper keyword} field,
* etc. This parsing is done by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ protected IndexShard newShard(ShardRouting routing, IndexMetaData indexMetaData,
* @param indexMetaData indexMetaData for the shard, including any mapping
* @param indexSearcherWrapper an optional wrapper to be used during searchers
* @param globalCheckpointSyncer callback for syncing global checkpoints
* @param indexEventListener
* @param indexEventListener index even listener
* @param listeners an optional set of listeners to add to the shard
*/
protected IndexShard newShard(ShardRouting routing, ShardPath shardPath, IndexMetaData indexMetaData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ protected String[] shuffleProtectedFields() {
* To find the right position in the root query, we add a marker as `queryName` which
* all query builders support. The added bogus field after that should trigger the exception.
* Queries that allow arbitrary field names at this level need to override this test.
* @throws IOException
*/
public void testUnknownField() throws IOException {
String marker = "#marker#";
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugin/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ dependencies {

// security deps
compile 'com.unboundid:unboundid-ldapsdk:3.2.0'
compile 'org.bouncycastle:bcprov-jdk15on:1.58'
compile 'org.bouncycastle:bcpkix-jdk15on:1.58'
compile 'org.bouncycastle:bcprov-jdk15on:1.59'
compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
compile project(path: ':modules:transport-netty4', configuration: 'runtime')

testCompile 'org.elasticsearch:securemock:1.2'
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugin/core/licenses/bcpkix-jdk15on-1.58.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions x-pack/plugin/core/licenses/bcpkix-jdk15on-1.59.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9cef0aab8a4bb849a8476c058ce3ff302aba3fff
1 change: 0 additions & 1 deletion x-pack/plugin/core/licenses/bcprov-jdk15on-1.58.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions x-pack/plugin/core/licenses/bcprov-jdk15on-1.59.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2507204241ab450456bdb8e8c0a8f986e418bd99
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ final TimeValue delay(long expirationDate, long now) {
}

/**
* {@link SchedulerEngine.Schedule#nextScheduledTimeAfter(long, long)} with respect to
* license expiry date
* {@link org.elasticsearch.xpack.core.scheduler.SchedulerEngine.Schedule#nextScheduledTimeAfter(long, long)}
* with respect to license expiry date
*/
public final long nextScheduledTimeForExpiry(long expiryDate, long startTime, long time) {
TimeValue delay = delay(expiryDate, time);
Expand Down Expand Up @@ -169,4 +169,4 @@ public final String toString() {
orientation.name(), TimeValue.timeValueMillis(min), TimeValue.timeValueMillis(max),
TimeValue.timeValueMillis(frequency));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ Asn1Object readAsn1Object() throws IOException {
* Decode the length of the field. Can only support length
* encoding up to 4 octets.
* <p>
* <p/>In BER/DER encoding, length can be encoded in 2 forms,
* In BER/DER encoding, length can be encoded in 2 forms:
* </p>
* <ul>
* <li>Short form. One octet. Bit 8 has value "0" and bits 7-1
* give the length.
Expand All @@ -100,7 +101,6 @@ Asn1Object readAsn1Object() throws IOException {
* </ul>
*
* @return The length as integer
* @throws IOException
*/
private int getLength() throws IOException {

Expand Down Expand Up @@ -145,7 +145,8 @@ static class Asn1Object {
* Construct a ASN.1 TLV. The TLV could be either a
* constructed or primitive entity.
* <p>
* <p/>The first byte in DER encoding is made of following fields,
* The first byte in DER encoding is made of following fields:
* </p>
* <pre>
* -------------------------------------------------
* |Bit 8|Bit 7|Bit 6|Bit 5|Bit 4|Bit 3|Bit 2|Bit 1|
Expand Down Expand Up @@ -192,7 +193,6 @@ public boolean isConstructed() {
* For constructed field, return a parser for its content.
*
* @return A parser for the construct.
* @throws IOException
*/
public DerParser getParser() throws IOException {
if (!isConstructed())
Expand All @@ -205,7 +205,6 @@ public DerParser getParser() throws IOException {
* Get the value as integer
*
* @return BigInteger
* @throws IOException
*/
public BigInteger getInteger() throws IOException {
if (type != DerParser.INTEGER)
Expand Down
Loading