icodening commented on issue #10597: URL: https://github.com/apache/dubbo/issues/10597#issuecomment-1246839075
改造问题记录: * 高并发时偶现`headers not received before payload` 构造`StreamChannel`时调用了直接`syncUninterruptibly`取出channel,然后再`addLast`会导致高并发时偶现`headers not received before payload`。其本质原因是`addLast`会判断是否为`eventloop`线程组,如果不是则会提交任务到`eventloop`中,那么持续高并发的情况下就有可能出现:`请求发送成功并且收到了响应,但pipeline实际上并未组装完成,导致header丢失,从而报错 headers not received before payload`。具体源码参见`io.netty.channel.AbstractChannelHandlerContext#invokeHandler` ````java Http2StreamChannel channel = bootstrap.open().syncUninterruptibly().getNow(); channel.pipeline().addLast(new TripleHttp2ClientResponseHandler(createTransportListener())); channel.closeFuture().addListener(f -> transportException(f.cause())); ```` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org