[alibaba/arthas]经过 tunnel server连接,查看arthas-output 不支持大文件

2024-07-09 859 views
4

比如 profiler生成比较大结果时就会出错。

2021-12-22 19:51:26 [arthas-ProxyClient-19-1] ERROR c.a.arthas.tunnel.client.ProxyClient -Proxy Client error
com.alibaba.arthas.deps.io.netty.handler.codec.TooLongFrameException: Response entity too large: DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
content-length: 10485760
content-type: application/octet-stream
date: Wed, 22 Dec 2021 11:51:26 GMT
expires: Wed, 22 Dec 2021 12:51:26 GMT
cache-control: private, max-age=3600
last-modified: Wed, 22 Dec 2021 11:51:02 GMT
        at com.alibaba.arthas.deps.io.netty.handler.codec.http.HttpObjectAggregator.handleOversizedMessage(HttpObjectAggregator.java:276)
        at com.alibaba.arthas.deps.io.netty.handler.codec.http.HttpObjectAggregator.handleOversizedMessage(HttpObjectAggregator.java:87)
        at com.alibaba.arthas.deps.io.netty.handler.codec.MessageAggregator.invokeHandleOversizedMessage(MessageAggregator.java:404)
        at com.alibaba.arthas.deps.io.netty.handler.codec.MessageAggregator.decode(MessageAggregator.java:254)
        at com.alibaba.arthas.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
        at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
        at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
        at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

主要是ProxyClient是一个简单的http client,并不是全功能的http proxy。

在代码里直接指定了最大包大小: ArthasConstants.MAX_HTTP_CONTENT_LENGTH

回答

7

MAX_HTTP_CONTENT_LENGTH在API的情况下应该不太容易超的吧。profiler 是图片所以容易有这个问题。不过2024这个pr我纠结的是换用localChannel会卡住,socketChannel就没问题?