elasticsearch
elasticsearch copied to clipboard
[CI] Netty4HttpServerTransportTests testChannelAcceptorCannotTamperThreadContext failing
Build scan: https://gradle-enterprise.elastic.co/s/yqf7kpf3qc4jg/tests/:modules:transport-netty4:test/org.elasticsearch.http.netty4.Netty4HttpServerTransportTests/testChannelAcceptorCannotTamperThreadContext
Reproduction line:
gradlew ':modules:transport-netty4:test' --tests "org.elasticsearch.http.netty4.Netty4HttpServerTransportTests.testChannelAcceptorCannotTamperThreadContext" -Dtests.seed=F5D355E8719865F5 -Dtests.locale=hu -Dtests.timezone=Asia/Atyrau -Druntime.java=21
Applicable branches: main
Reproduces locally?: No
Failure history:
Failure dashboard for org.elasticsearch.http.netty4.Netty4HttpServerTransportTests#testChannelAcceptorCannotTamperThreadContext
Failure excerpt:
java.lang.AssertionError: java.io.IOException: An established connection was aborted by the software in your host machine
at __randomizedtesting.SeedInfo.seed([F5D355E8719865F5]:0)
at org.elasticsearch.http.netty4.Netty4HttpClient$CountDownLatchHandler$1.exceptionCaught(Netty4HttpClient.java:210)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireExceptionCaught(CombinedChannelDuplexHandler.java:424)
at io.netty.channel.ChannelHandlerAdapter.exceptionCaught(ChannelHandlerAdapter.java:92)
at io.netty.channel.CombinedChannelDuplexHandler$1.fireExceptionCaught(CombinedChannelDuplexHandler.java:145)
at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:143)
at io.netty.channel.CombinedChannelDuplexHandler.exceptionCaught(CombinedChannelDuplexHandler.java:231)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325)
at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:125)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:177)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:689)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:1583)
Caused by: java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(SocketDispatcher.java:-2)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:46)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:340)
at sun.nio.ch.IOUtil.read(IOUtil.java:294)
at sun.nio.ch.IOUtil.read(IOUtil.java:269)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:425)
at org.elasticsearch.transport.netty4.CopyBytesSocketChannel.readFromSocketChannel(CopyBytesSocketChannel.java:131)
at org.elasticsearch.transport.netty4.CopyBytesSocketChannel.doReadBytes(CopyBytesSocketChannel.java:116)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:689)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:1583)
Pinging @elastic/es-security (Team:Security)
Seems to fail consistently on Windows hosts. Will try to look closer.
This fails quite often on Windows
- https://gradle-enterprise.elastic.co/s/insskiuls6rfi
- https://gradle-enterprise.elastic.co/s/vens6cugrf75a
- https://gradle-enterprise.elastic.co/s/rokh7j5qgicbm
It failed again https://gradle-enterprise.elastic.co/s/2ufy4uu7btph6/tests/task/:modules:transport-netty4:pooledTest/details/org.elasticsearch.http.netty4.Netty4HttpServerTransportTests/testChannelAcceptorCannotTamperThreadContext?top-execution=1
@Tim-Brooks do you have any tips on this one please?
I imagine it is because the way a rejected channel is closed on windows breaks the assertion for caught exceptions in the client.
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
if (cause instanceof PrematureChannelClosureException || cause instanceof SocketException) {
// no more requests coming, so fast-forward the latch
fastForward();
} else {
ExceptionsHelper.maybeDieOnAnotherThread(new AssertionError(cause));
}
}
Windows appears to be returning this as java.io.IOException. Which seems fine. Just an issue with the test expectations.
I've re-opened https://github.com/elastic/elasticsearch/pull/108362, which handles this java.io.IOException in Netty4HttpClient.
Another failure : https://gradle-enterprise.elastic.co/s/gdq6e3zg6ggea