Skip to content

Commit ad7229f

Browse files
committed
Merge branch 'master' into feature/seq_no
* master: (158 commits) Document the hack Refactor property placeholder use of env. vars Force java9 log4j hack in testing Fix log4j buggy java version detection Make java9 work again Don't mkdir directly in deb init script Fix env. var placeholder test so it's reproducible Remove ScriptMode class in favor of boolean true/false [rest api spec] fix doc urls Netty request/response tracer should wait for send Filter client/server VM options from jvm.options [rest api spec] fix url for reindex api docs Remove use of a Fields class in snapshot responses that contains x-content keys, in favor of declaring/using the keys directly. Limit retries of failed allocations per index (#18467) Proxy box method to use valueOf. Use the build-in valueOf method instead of the custom one. Fixed tests and added a comment to the box method. Fix boxing. Do not decode path when sending error Fix race condition in snapshot initialization ...
2 parents f6694be + cec4b9a commit ad7229f

File tree

825 files changed

+25923
-15550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

825 files changed

+25923
-15550
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ Once your changes and tests are ready to submit for review:
7171

7272
Then sit back and wait. There will probably be discussion about the pull request and, if any changes are needed, we would love to work with you to get your pull request merged into Elasticsearch.
7373

74+
Please adhere to the general guideline that you should never force push
75+
to a publicly shared branch. Once you have opened your pull request, you
76+
should consider your branch publicly shared. Instead of force pushing
77+
you can just add incremental commits; this is generally easier on your
78+
reviewers. If you need to pick up changes from master, you can merge
79+
master into your branch. A reviewer might ask you to rebase a
80+
long-running pull request in which case force pushing is okay for that
81+
request. Note that squashing at the end of the review process should
82+
also not be done, that can be done when the pull request is [integrated
83+
via GitHub](https://github.com/blog/2141-squash-your-commits).
84+
7485
Contributing to the Elasticsearch codebase
7586
------------------------------------------
7687

TESTING.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ gradle test -Dtests.timeoutSuite=5000! ...
201201
Change the logging level of ES (not gradle)
202202

203203
--------------------------------
204-
gradle test -Des.logger.level=DEBUG
204+
gradle test -Dtests.logger.level=DEBUG
205205
--------------------------------
206206

207207
Print all the logging output from the test runs to the commandline

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class BuildPlugin implements Plugin<Project> {
378378
* -serial because we don't use java serialization.
379379
*/
380380
// don't even think about passing args with -J-xxx, oracle will ask you to submit a bug report :)
381-
options.compilerArgs << '-Werror' << '-Xlint:all,-path,-serial' << '-Xdoclint:all' << '-Xdoclint:-missing'
381+
options.compilerArgs << '-Werror' << '-Xlint:all,-path,-serial,-options' << '-Xdoclint:all' << '-Xdoclint:-missing'
382382
// compile with compact 3 profile by default
383383
// NOTE: this is just a compile time check: does not replace testing with a compact3 JRE
384384
if (project.compactProfile != 'full') {
@@ -456,7 +456,7 @@ class BuildPlugin implements Plugin<Project> {
456456
// default test sysprop values
457457
systemProperty 'tests.ifNoTests', 'fail'
458458
// TODO: remove setting logging level via system property
459-
systemProperty 'es.logger.level', 'WARN'
459+
systemProperty 'tests.logger.level', 'WARN'
460460
for (Map.Entry<String, String> property : System.properties.entrySet()) {
461461
if (property.getKey().startsWith('tests.') ||
462462
property.getKey().startsWith('es.')) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
144144
if (query != null) {
145145
for (String param: query.tokenize('&')) {
146146
def (String name, String value) = param.tokenize('=')
147+
if (value == null) {
148+
value = ''
149+
}
147150
current.println(" $name: \"$value\"")
148151
}
149152
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ class NodeInfo {
129129
}
130130

131131
env = [ 'JAVA_HOME' : project.javaHome ]
132-
args.addAll("-E", "es.node.portsfile=true")
132+
args.addAll("-E", "node.portsfile=true")
133+
String loggerLevel = System.getProperty("tests.logger.level")
134+
if (loggerLevel != null) {
135+
args.addAll("-E", "logger.level=${loggerLevel}")
136+
}
133137
String collectedSystemProperties = config.systemProperties.collect { key, value -> "-D${key}=${value}" }.join(" ")
134138
String esJavaOpts = config.jvmArgs.isEmpty() ? collectedSystemProperties : collectedSystemProperties + " " + config.jvmArgs
135139
env.put('ES_JAVA_OPTS', esJavaOpts)
@@ -140,7 +144,7 @@ class NodeInfo {
140144
}
141145
}
142146
env.put('ES_JVM_OPTIONS', new File(confDir, 'jvm.options'))
143-
args.addAll("-E", "es.path.conf=${confDir}")
147+
args.addAll("-E", "path.conf=${confDir}")
144148
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
145149
args.add('"') // end the entire command, quoted
146150
}

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@
517517
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]ingest[/\\]processor[/\\]ConvertProcessor.java" checks="LineLength" />
518518
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]GcNames.java" checks="LineLength" />
519519
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]HotThreads.java" checks="LineLength" />
520-
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmGcMonitorService.java" checks="LineLength" />
521520
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmStats.java" checks="LineLength" />
522521
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]node[/\\]Node.java" checks="LineLength" />
523522
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]node[/\\]internal[/\\]InternalSettingsPreparer.java" checks="LineLength" />
@@ -1336,7 +1335,6 @@
13361335
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]junit[/\\]listeners[/\\]LoggingListener.java" checks="LineLength" />
13371336
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]ESRestTestCase.java" checks="LineLength" />
13381337
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]RestTestExecutionContext.java" checks="LineLength" />
1339-
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]client[/\\]RestClient.java" checks="LineLength" />
13401338
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]client[/\\]http[/\\]HttpRequestBuilder.java" checks="LineLength" />
13411339
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]json[/\\]JsonPath.java" checks="LineLength" />
13421340
<suppress files="test[/\\]framework[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]test[/\\]rest[/\\]parser[/\\]GreaterThanEqualToParser.java" checks="LineLength" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
<% commands.each {command -> %><%= command %><% } %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
<% commands.each {command -> %><%= command %><% } %>

buildSrc/version.properties

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ jna = 4.1.0
1313
# test dependencies
1414
randomizedrunner = 2.3.2
1515
junit = 4.11
16-
# TODO: Upgrade httpclient to a version > 4.5.1 once released. Then remove o.e.test.rest.client.StrictHostnameVerifier* and use
17-
# DefaultHostnameVerifier instead since we no longer need to workaround https://issues.apache.org/jira/browse/HTTPCLIENT-1698
18-
httpclient = 4.3.6
19-
httpcore = 4.3.3
16+
httpclient = 4.5.2
17+
httpcore = 4.4.4
2018
commonslogging = 1.1.3
2119
commonscodec = 1.10
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.log4j;
21+
22+
import org.apache.log4j.helpers.ThreadLocalMap;
23+
24+
/**
25+
* Log4j 1.2 MDC breaks because it parses java.version incorrectly (does not handle new java9 versioning).
26+
*
27+
* This hack fixes up the pkg private members as if it had detected the java version correctly.
28+
*/
29+
public class Java9Hack {
30+
31+
public static void fixLog4j() {
32+
if (MDC.mdc.tlm == null) {
33+
MDC.mdc.java1 = false;
34+
MDC.mdc.tlm = new ThreadLocalMap();
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)