繁体   English   中英

JMeter 在 GRPC 服务器上测试:服务器端异常:io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception

[英]JMeter testing on GRPC Server: Server-side exception: io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception

在 spring 引导服务器的 GRPC API 上进行响应时间测试时,我遇到了 JMeter 的这个问题。 我在类似的情况下读到它与 TLS 配置有关,但在我的情况下我不确定。 我只有在 30 秒内测试大约 1000 个请求时才会遇到这个问题,然后大约 950 个可以,200 个和 50 个会抛出这个服务器端异常。

io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 16030100890100008503038bc456665bba06cf1a9f93f4f4
        at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:103) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.readClientPrefaceString(Http2ConnectionHandler.java:306) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:239) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:438) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:498) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:437) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:792) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[grpc-netty-shaded-1.31.1.jar!/:1.31.1]
        at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

字节160301是客户端向服务器发送的第一个 TLS 字节。

在您的情况下,服务器回复说它期待 HTTP/2 客户端前言。

这意味着您的客户端正在尝试将加密字节发送到明文服务器端口。

检查您是否使用了正确的方案,它必须是http ,而不是https (因为服务器需要明文字节)。

或者,将您的服务器配置为接受该端口上的加密字节。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM