Skip to content

Commit

Permalink
Set netty system properties in BuildPlugin (#45881)
Browse files Browse the repository at this point in the history
Currently in production instances of Elasticsearch we set a couple of
system properties by default. We currently do not apply all of these
system properties in tests. This commit applies these properties in the
tests.
  • Loading branch information
Tim-Brooks committed Aug 29, 2019
1 parent 131a8de commit 12b76b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,12 @@ class BuildPlugin implements Plugin<Project> {
// TODO: remove this once cname is prepended to transport.publish_address by default in 8.0
test.systemProperty 'es.transport.cname_in_publish_address', 'true'

// Set netty system properties to the properties we configure in jvm.options
test.systemProperty('io.netty.noUnsafe', 'true')
test.systemProperty('io.netty.noKeySetOptimization', 'true')
test.systemProperty('io.netty.recycler.maxCapacityPerThread', '0')
test.systemProperty('io.netty.allocator.numDirectArenas', '0')

test.testLogging { TestLoggingContainer logging ->
logging.showExceptions = true
logging.showCauses = true
Expand Down
6 changes: 0 additions & 6 deletions modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ test {
* other if we allow them to set the number of available processors as it's set-once in Netty.
*/
systemProperty 'es.set.netty.runtime.available.processors', 'false'

// Disable direct buffer pooling as it is disabled by default in Elasticsearch
systemProperty 'io.netty.allocator.numDirectArenas', '0'
}

integTestRunner {
Expand All @@ -62,9 +59,6 @@ integTestRunner {
* other if we allow them to set the number of available processors as it's set-once in Netty.
*/
systemProperty 'es.set.netty.runtime.available.processors', 'false'

// Disable direct buffer pooling as it is disabled by default in Elasticsearch
systemProperty 'io.netty.allocator.numDirectArenas', '0'
}

thirdPartyAudit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ private static void setTestSysProps() {

// Enable Netty leak detection and monitor logger for logged leak errors
System.setProperty("io.netty.leakDetection.level", "paranoid");

// Disable direct buffer pooling
System.setProperty("io.netty.allocator.numDirectArenas", "0");
}

protected final Logger logger = LogManager.getLogger(getClass());
Expand Down

0 comments on commit 12b76b8

Please sign in to comment.