Skip to content

Commit 7d7463f

Browse files
committed
Upgrade to Netty 4.1.25.Final (#31232)
This commit upgrades us to Netty 4.1.25. This upgrade is more challenging than past upgrades, all because of a new object cleaner thread that they have added. This thread requires an additional security permission (set context class loader, needed to avoid leaks in certain scenarios). Additionally, there is not a clean way to shutdown this thread which means that the thread can fail thread leak control during tests. As such, we have to filter this thread from thread leak control.
1 parent dbef9d9 commit 7d7463f

File tree

66 files changed

+304
-72
lines changed

Some content is hidden

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

66 files changed

+304
-72
lines changed

modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.index.reindex;
2121

22+
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
2223
import org.apache.lucene.util.SetOnce;
2324
import org.elasticsearch.ElasticsearchSecurityException;
2425
import org.elasticsearch.ElasticsearchStatusException;
@@ -41,6 +42,7 @@
4142
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
4243
import org.elasticsearch.env.Environment;
4344
import org.elasticsearch.env.NodeEnvironment;
45+
import org.elasticsearch.index.reindex.test.ObjectCleanerThreadThreadFilter;
4446
import org.elasticsearch.plugins.ActionPlugin;
4547
import org.elasticsearch.plugins.Plugin;
4648
import org.elasticsearch.rest.RestStatus;
@@ -64,6 +66,7 @@
6466
import static org.elasticsearch.index.reindex.ReindexTestCase.matcher;
6567
import static org.hamcrest.Matchers.containsString;
6668

69+
@ThreadLeakFilters(filters = {ObjectCleanerThreadThreadFilter.class})
6770
public class ReindexFromRemoteWithAuthTests extends ESSingleNodeTestCase {
6871
private TransportAddress address;
6972

modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.index.reindex;
2121

22+
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
2223
import org.elasticsearch.action.ActionFuture;
2324
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
2425
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
@@ -33,6 +34,7 @@
3334
import org.elasticsearch.common.transport.TransportAddress;
3435
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
3536
import org.elasticsearch.index.query.QueryBuilders;
37+
import org.elasticsearch.index.reindex.test.ObjectCleanerThreadThreadFilter;
3638
import org.elasticsearch.plugins.Plugin;
3739
import org.elasticsearch.test.ESIntegTestCase;
3840
import org.elasticsearch.threadpool.ThreadPool;
@@ -56,6 +58,7 @@
5658
* Integration test for retry behavior. Useful because retrying relies on the way that the
5759
* rest of Elasticsearch throws exceptions and unit tests won't verify that.
5860
*/
61+
@ThreadLeakFilters(filters = {ObjectCleanerThreadThreadFilter.class})
5962
public class RetryTests extends ESIntegTestCase {
6063

6164
private static final int DOC_COUNT = 20;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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.elasticsearch.index.reindex.test;
21+
22+
import com.carrotsearch.randomizedtesting.ThreadFilter;
23+
24+
public class ObjectCleanerThreadThreadFilter implements ThreadFilter {
25+
26+
@Override
27+
public boolean reject(final Thread t) {
28+
// TODO: replace with constant from Netty when https://github.com/netty/netty/pull/8014 is integrated
29+
return "ObjectCleanerThread".equals(t.getName());
30+
}
31+
32+
}

modules/transport-netty4/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ compileTestJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-tr
3434

3535
dependencies {
3636
// network stack
37-
compile "io.netty:netty-buffer:4.1.16.Final"
38-
compile "io.netty:netty-codec:4.1.16.Final"
39-
compile "io.netty:netty-codec-http:4.1.16.Final"
40-
compile "io.netty:netty-common:4.1.16.Final"
41-
compile "io.netty:netty-handler:4.1.16.Final"
42-
compile "io.netty:netty-resolver:4.1.16.Final"
43-
compile "io.netty:netty-transport:4.1.16.Final"
37+
compile "io.netty:netty-buffer:4.1.25.Final"
38+
compile "io.netty:netty-codec:4.1.25.Final"
39+
compile "io.netty:netty-codec-http:4.1.25.Final"
40+
compile "io.netty:netty-common:4.1.25.Final"
41+
compile "io.netty:netty-handler:4.1.25.Final"
42+
compile "io.netty:netty-resolver:4.1.25.Final"
43+
compile "io.netty:netty-transport:4.1.25.Final"
4444
}
4545

4646
dependencyLicenses {
@@ -161,6 +161,6 @@ thirdPartyAudit.excludes = [
161161

162162
'org.conscrypt.AllocatedBuffer',
163163
'org.conscrypt.BufferAllocator',
164-
'org.conscrypt.Conscrypt$Engines',
164+
'org.conscrypt.Conscrypt',
165165
'org.conscrypt.HandshakeListener'
166166
]

modules/transport-netty4/licenses/netty-buffer-4.1.16.Final.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f366d0cc87b158ca064d27507127e3cc4eb2f089

modules/transport-netty4/licenses/netty-codec-4.1.16.Final.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3e465c75bead40d06b5b9c0612b37cf77c548887

modules/transport-netty4/licenses/netty-codec-http-4.1.16.Final.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
70888d3f2a829541378f68503ddd52c3193df35a

0 commit comments

Comments
 (0)