Skip to content

Unable to download JFR recordings larger than 10MB via Tunnel Server #3034

Open

Description

@amalpotra
  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Arthas version: 4.0.5
  • Operating System version: Ubuntu 24.04 LTS
  • Java version of target JVM: 21.0.7
  • Java version of JVM used to attach: 21.0.7

Preconditions / Setup

  1. Arthas is attached to the application as a Java agent and connected to the tunnel-server.
  2. The Arthas Web Console is used to start JFR profiling of the application.
  3. After profiling finishes, the generated recording is listed under Outputs.

Steps to reproduce this issue

  1. In the Web Console, click Download for a recording whose size exceeds 10 MB.
  2. Observe the downloaded file.

Expected Result

The full .jfr file is downloaded intact, regardless of size.

Actual Result

• Recordings ≤ 10 MB download correctly.
• Recordings > 10 MB download as a small file that contains only the text:

error

Stack trace from tunnel-server:

com.alibaba.arthas.deps.io.netty.handler.codec.http.TooLongHttpContentException: Response entity too large: DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
  at com.alibaba.arthas.deps.io.netty.handler.codec.http.HttpObjectAggregator.handleOversizedMessage(HttpObjectAggregator.java:275)
  at com.alibaba.arthas.deps.io.netty.handler.codec.http.HttpObjectAggregator.handleOversizedMessage(HttpObjectAggregator.java:86)
  at com.alibaba.arthas.deps.io.netty.handler.codec.MessageAggregator.invokeHandleOversizedMessage(MessageAggregator.java:403)
  at com.alibaba.arthas.deps.io.netty.handler.codec.MessageAggregator.decode(MessageAggregator.java:252)
  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:444)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
  at com.alibaba.arthas.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
  at com.alibaba.arthas.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
  at com.alibaba.arthas.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
  at com.alibaba.arthas.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
  at com.alibaba.arthas.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
  at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
  at com.alibaba.arthas.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
  at com.alibaba.arthas.deps.io.netty.channel.local.LocalChannel.readInbound(LocalChannel.java:323)
  at com.alibaba.arthas.deps.io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:469)
  at com.alibaba.arthas.deps.io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:51)
  at com.alibaba.arthas.deps.io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:427)
  at com.alibaba.arthas.deps.io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
  at com.alibaba.arthas.deps.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
  at com.alibaba.arthas.deps.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
  at com.alibaba.arthas.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
  at com.alibaba.arthas.deps.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
  at com.alibaba.arthas.deps.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
  at com.alibaba.arthas.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
  at java.base/java.lang.Thread.run(Unknown Source)

Here are the suspected areas:

  1. httpResponse.setContent("error".getBytes("utf-8"));
  2. public static final int MAX_HTTP_CONTENT_LENGTH = 1024 * 1024 * 10;

Questions

  1. Is the 10 MB ceiling intentional/expected?
  2. If intentional, is there a recommended work-around to download JFR files larger than 10 MB via tunnel-server for those with no direct access to production system other than the web-console?

Thanks for your help!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions