With Netty Epoll throw readAddress(..) failed: Connection timed out
env
Java : 1.8.0_144 vertx: 3.5.0 with cluster manager Hazelcast netty: netty-all:4.1.19.Final os: ubuntu 16.04
I use vertx to create tcp server and set setPreferNativeTransport = true ,NetServerOptions
NetServerOptions ops = new NetServerOptions();
ops.setReceiveBufferSize(32 * 1024)
.setSendBufferSize(32 * 1024)
.setIdleTimeout(timeoutSecond)
.setPort(port)
.setHost(host)
.setTcpFastOpen(true)
.setTcpQuickAck(true)
.setUsePooledBuffers(true)
.setTcpNoDelay(true);
client will send 3 kinds package
- < 38B every 1 second ,server just receive then send to kafka
- 1.2KB every 1 second ,server just receive then send to kafka
- heartbeat 35B every 5 seconds , server send ack
log.info("write data to client...[{}]", StringUtil.toHexString(cmd.getBytes()));
if (Objects.isNull(client)) {
return false;
}
client.write(cmd);
if (client.writeQueueFull()) {
client.pause();
client.drainHandler(done -> client.resume());
}
with 1000 clients after a few hours netty will throw readAddress(..) failed: Connection timed out
2018-02-01 07:36:59,545 [ERROR] [vert.x-eventloop-thread-9]
DataHubBroker [DataHubBroker.java : 154] device error io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection timed out
at io.netty.channel.unix.Errors.newIOException(Errors.java:122)
at io.netty.channel.unix.Errors.ioResult(Errors.java:146)
at io.netty.channel.unix.FileDescriptor.readAddress(FileDescriptor.java:178)
at io.netty.channel.epoll.AbstractEpollChannel.doReadBytes(AbstractEpollChannel.java:347)
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:786)
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:404)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
I find netty issues.but it close at 4.0.26 .Any ideas for help?
you should use netty-all:4.1.15.Final with 3.5.0
I also use redisson too. it require Netty 4.1.19. when setPreferNativeTransport = false it works .I don't why
do you have a good reason to prefer native transport over java NIO ?
imho it looks like more a Netty issue than a Vert.x issue
just see vertx support native transport and want to try....