[ https://issues.apache.org/jira/browse/FLINK-3952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494881#comment-16494881 ]
ASF GitHub Bot commented on FLINK-3952: --------------------------------------- Github user pnowojski commented on a diff in the pull request: https://github.com/apache/flink/pull/6071#discussion_r191683459 --- Diff: flink-tests/src/test/java/org/apache/flink/test/runtime/NettyEpollITCase.java --- @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.test.runtime; + +import org.apache.flink.api.java.functions.KeySelector; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.streaming.api.datastream.DataStream; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.test.util.MiniClusterResource; +import org.apache.flink.test.util.MiniClusterResource.MiniClusterResourceConfiguration; +import org.apache.flink.util.TestLogger; + +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Optional; + +import static org.apache.flink.runtime.io.network.netty.NettyConfig.TRANSPORT_TYPE; +import static org.apache.flink.util.ExceptionUtils.findThrowableWithMessage; + +/** + * Test network stack with taskmanager.network.netty.transport set to epoll. This test car only run + * on linux. On other platforms it's basically a NO-OP. See + * https://github.com/apache/flink-shaded/issues/30 + */ +public class NettyEpollITCase extends TestLogger { + + private static final Logger LOG = LoggerFactory.getLogger(NettyEpollITCase.class); + + private static final int TASK_MANAGERES = 2; + + @Test + public void testNettyEpoll() throws Exception { + Optional<MiniClusterResource> cluster = trySetUp(); + if (!cluster.isPresent()) { + return; + } + + try { + StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); + env.setParallelism(TASK_MANAGERES); + env.getConfig().disableSysoutLogging(); + + DataStream<Integer> input = env.fromElements(1, 2, 3, 4, 1, 2, 3, 42); + input.keyBy(new KeySelector<Integer, Integer>() { + @Override + public Integer getKey(Integer value) throws Exception { + return value; + } + }) + .sum(0) + .print(); + + env.execute(); + } + finally { + cluster.get().after(); + } + } + + private Optional<MiniClusterResource> trySetUp() throws Exception { + try { + MiniClusterResource cluster = new MiniClusterResource( + new MiniClusterResourceConfiguration( + getConfiguration(), + TASK_MANAGERES, + 1), + true); + cluster.before(); + return Optional.of(cluster); + } + catch (UnsatisfiedLinkError ex) { + // If we failed to init netty because we are not on Linux platform, abort the test. + if (findThrowableWithMessage(ex, "Only supported on Linux").isPresent()) { + return Optional.empty(); --- End diff -- I didn't know about `AssumptionViolatedException`. Thanks for pointing this out. > Bump Netty to 4.1 > ----------------- > > Key: FLINK-3952 > URL: https://issues.apache.org/jira/browse/FLINK-3952 > Project: Flink > Issue Type: Improvement > Components: Core, Network > Reporter: rektide de la fey > Assignee: Piotr Nowojski > Priority: Major > Labels: netty > > Netty 4.1 is about to release final. This release has [a number of > significant > enhancements|http://netty.io/wiki/new-and-noteworthy-in-4.1.html], and in > particular I find HTTP/2 codecs to be incredibly desirable to have. > Additionally, hopefully, the [Hadoop patches for Netty > 4.1|https://issues.apache.org/jira/browse/HADOOP-11716] get some tests and > get merged, & I believe if/when that happens it'll be important for Flink to > also be using the new Netty minor version. -- This message was sent by Atlassian JIRA (v7.6.3#76005)