alibaba / alibaba/arthas

通过下发命令的方式启动arthas,启动进程卡住不动

Open
#3,028 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
37.6k
Forks
7.6k
Avg merge
1d 22h
Merged PRs (30d)
4

Description

- [ ] 我已经在 [issues](https://github.com/alibaba/arthas/issues) 里搜索,没有重复的issue。

### 环境信息

* `arthas-boot.jar` 或者 `as.sh` 的版本: 4.0.5
* Arthas 版本: 4.0.5
* 操作系统版本: linux
* 目标进程的JVM版本: openjdk version "1.8.0_412"
* 执行`arthas-boot`的版本: 4.0.5

### 重现问题的步骤

1. 命令通道平台,下发执行脚本命令
2. 执行nohup java -jar arthas-boot.jar --username xxx --password xxx --target-ip 0.0.0.0 --attach-only pid
3. ps auxf

### 期望的结果

正常启动,并监听8563等端口,可通过http api的方式交互

### 实际运行的结果

![Image](https://github.com/user-attachments/assets/2c8058fc-7455-439f-8fd5-c8f3dcdd4f0f)

jstatck -F pid

![Image](https://github.com/user-attachments/assets/010d6f63-4515-4438-a37a-6d9f494fca8e)

定位到代码是卡在这里com.taobao.arthas.client.TelnetConsole

![Image](https://github.com/user-attachments/assets/ba038210-d2c2-49c0-bc2c-0dcccff6b7ef)

来自com.taobao.arthas.boot.Bootstrap.findProcessByTelnetClient方法的调用
![Image](https://github.com/user-attachments/assets/4772a2aa-e884-4e6b-af64-52d274faf342)

我把这一句注释了,让它返回-1,就能正常下发arthas命令执行了。

命令下发的方式,就卡在这里,直接上机运行 java -jar arthas-boot.jar --username xxx --password xxx --target-ip 0.0.0.0 --attach-only pid 反而不会卡住。不知道为什么

Contributor guide

Open the contributing guide

Research direction

Start with com.taobao.arthas.boot.Bootstrap.findProcessByTelnetClient and the com.taobao.arthas.client.TelnetConsole location identified in the report. Reproduce the nohup arthas-boot.jar command through the command platform and directly on the host, then compare the startup behavior. Done means the process starts and listens on the expected ports without commenting out the method call.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.