Skip to content
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

Update Netty to 4.1.16.Final #28345

Merged
merged 8 commits into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
32 changes: 16 additions & 16 deletions modules/transport-netty4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ compileTestJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-tr

dependencies {
// network stack
compile "io.netty:netty-buffer:4.1.13.Final"
compile "io.netty:netty-codec:4.1.13.Final"
compile "io.netty:netty-codec-http:4.1.13.Final"
compile "io.netty:netty-common:4.1.13.Final"
compile "io.netty:netty-handler:4.1.13.Final"
compile "io.netty:netty-resolver:4.1.13.Final"
compile "io.netty:netty-transport:4.1.13.Final"
compile "io.netty:netty-buffer:4.1.18.Final"
compile "io.netty:netty-codec:4.1.18.Final"
compile "io.netty:netty-codec-http:4.1.18.Final"
compile "io.netty:netty-common:4.1.18.Final"
compile "io.netty:netty-handler:4.1.18.Final"
compile "io.netty:netty-resolver:4.1.18.Final"
compile "io.netty:netty-transport:4.1.18.Final"
}

dependencyLicenses {
Expand Down Expand Up @@ -149,18 +149,18 @@ thirdPartyAudit.excludes = [
'io.netty.util.internal.PlatformDependent0$3',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueue',
'io.netty.util.internal.shaded.org.jctools.queues.ConcurrentSequencedCircularArrayQueue',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields',
'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like these got moved out of alphabetical order?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode',
'io.netty.util.internal.shaded.org.jctools.queues.MpmcArrayQueueConsumerField',
'io.netty.util.internal.shaded.org.jctools.queues.MpmcArrayQueueProducerField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueHeadLimitField',
'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueTailField',
'io.netty.util.internal.shaded.org.jctools.util.JvmInfo',
'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess',
'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess',

'org.conscrypt.Conscrypt$Engines',
'org.conscrypt.AllocatedBuffer',
'org.conscrypt.BufferAllocator',
'org.conscrypt.Conscrypt',
'org.conscrypt.HandshakeListener'
]

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2985accbe0c3ab5de6ebcb1574986230467ed652
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.util.NettyRuntime;
import io.netty.util.internal.ThrowableUtil;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import org.apache.logging.log4j.Logger;
Expand All @@ -35,6 +36,8 @@
import org.elasticsearch.common.logging.ESLoggerFactory;

import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand All @@ -61,7 +64,11 @@ public InternalLogger newInstance(final String name) {
}

public static void setup() {

// TODO remove this once we get a fix into Netty so we don't have to do this
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
ThrowableUtil.haveSuppressed();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you leave a comment that this is triggering class initialization? This is horrific.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed b073780

return null;
});
}

private static AtomicBoolean isAvailableProcessorsSet = new AtomicBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
* under the License.
*/

grant {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we grant this only to transport-netty4?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure this is handled by the module framework?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. A general grant means all the jars in this plugin.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite; it grants it to all JARs in the module and I am asking for this to be limited to transport-netty4 only.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or whatever Netty JAR this is in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can't work since the doPriv block is in our module code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be granted to our jar and the single netty jar explicitly though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that should have been an and, not an or.

// needed for Netty since they use reflection in ThrowableUtil :(
permission java.lang.RuntimePermission "accessDeclaredMembers";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we open an issue in netty and link here that netty should work gracefully if it does not have this permission?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened netty/netty#7614 and added in the comment of this section

};

grant codeBase "${codebase.netty-common}" {
// for reading the system-wide configuration for the backlog of established sockets
permission java.io.FilePermission "/proc/sys/net/core/somaxconn", "read";
Expand Down