Linux use Epoll
See original GitHub issueExpected behavior
at the linux os netty use epoll
Actual behavior
but have a excpetion when i start the netty:
2018-09-05 16:06:35,635 [main] DEBUG io.netty.util.internal.NativeLibraryLoader - Unable to load the library 'netty_transport_native_epoll_x86_64', trying other loading mechanism. java.lang.UnsatisfiedLinkError: no netty_transport_native_epoll_x86_64 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)
Steps to reproduce
Minimal yet complete reproducer code (or URL to code)
`private EventLoopGroup bossGroup = null;
private EventLoopGroup workerGroup = null;
private ServerBootstrap bootstrap = null;
if (osName.equals(“Linux”)) {
this.bossGroup = new EpollEventLoopGroup(ServerCoreInfo.DEFAULT_NETTY_CORE_THREAD_NUM);
this.workerGroup = new EpollEventLoopGroup(ServerCoreInfo.DEFAULT_NETTY_WORK_THREAD_NUM);
} else {
this.bossGroup = new NioEventLoopGroup(ServerCoreInfo.DEFAULT_NETTY_CORE_THREAD_NUM);
this.workerGroup = new NioEventLoopGroup(ServerCoreInfo.DEFAULT_NETTY_WORK_THREAD_NUM);
}
if (osName.equals(“Linux”)) { // Linux平台用Epoll模式 bootstrap.channel(EpollServerSocketChannel.class); } else { bootstrap.channel(NioServerSocketChannel.class); }`
Netty version
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.56.Final</version>
</dependency>
JVM version (e.g. java -version
)
java version “1.8.0_181” Java™ SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)
OS version (e.g. uname -a
)
Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
All is good as you can see here:
We try different loading strategies until we succeed. So the first few logs are because these were not successful.
@KING754 yes… thats why its debug and not warn or error.