Skip to content

Commit

Permalink
Merge branch 'master' into feature_time_display
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc authored Sep 20, 2023
2 parents 5e8f25c + c3c4007 commit b343869
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void renderNode(StringBuilder sb, TraceNode node, Ansi highlighted) {
sb.append(format("ts=%s;thread_name=%s;id=%s;is_daemon=%s;priority=%d;TCCL=%s",
DateUtils.formatDateTime(threadNode.getTimestamp()),
threadNode.getThreadName(),
Long.toHexString(threadNode.getThreadId()),
threadNode.getThreadId(),
threadNode.isDaemon(),
threadNode.getPriority(),
threadNode.getClassloader()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ private static int findTheSpyAPIDepth(StackTraceElement[] stackTraceElementArray
public static StackModel getThreadStackModel(ClassLoader loader, Thread currentThread) {
StackModel stackModel = new StackModel();
stackModel.setThreadName(currentThread.getName());
stackModel.setThreadId(Long.toHexString(currentThread.getId()));
stackModel.setThreadId(Long.toString(currentThread.getId()));
stackModel.setDaemon(currentThread.isDaemon());
stackModel.setPriority(currentThread.getPriority());
stackModel.setClassloader(getTCCL(currentThread));
Expand Down
12 changes: 12 additions & 0 deletions site/docs/doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ ognl '@java.lang.System@out.println("Hello \u4e2d\u6587")'

可以。下载全量包解压即可,参考: [下载](download.md)

### Arthas 怎么使用指定版本,不使用自动升级版本

1. 启动 `as.sh`/`arthas-boot.jar`时,可以用 `--use-version` 参数指定。
2. 下载全量包,解压后,`cd`到arthas目录启动,这种情况会使用当前目录下的版本。

### Attach docker/k8s 里的 pid 为 1 的进程失败

参考: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416](https://github.com/alibaba/arthas/issues/362#issuecomment-448185416)
Expand All @@ -109,3 +114,10 @@ ognl '@java.lang.System@out.println("Hello \u4e2d\u6587")'
比如启动的 `as.sh/arthas-boot.jar` 版本是 3.5._ 的,但是连接上之后,打印的 arthas 版本是 3.4._ 的。

可能是之前使用旧版本的 arthas 诊断过目标进程。可以先执行`stop`停止掉旧版本的 arthas,再重新使用新版本 attach。

### 在ognl表达式中获取到 spring bean cglib 对象,但是 field 是 null

参考:

- [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802)
- [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424)
12 changes: 12 additions & 0 deletions site/docs/en/doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ Reference: [https://github.com/alibaba/arthas/issues/2165](https://github.com/al

Yes. Just download the full size package and unzip it, refer to: [Download](download.md).

### How to use the specified version of Arthas without using the automatic upgrade version?

1. When starting `as.sh`/`arthas-boot.jar`, you can specify it with the `--use-version` parameter.
2. Download the full package, unzip it, and cd to the arthas directory to start. In this case, the version in the current directory will be used.

### Attach the process with pid 1 in docker/k8s failed

Reference: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416](https://github.com/alibaba/arthas/issues/362#issuecomment-448185416)
Expand All @@ -109,3 +114,10 @@ Reference: [https://github.com/alibaba/arthas/issues/362#issuecomment-448185416]
For example, the started version of `as.sh/arthas-boot.jar` is 3.5._, but after connecting, the printed arthas version is 3.4._.

It may be that the target process has been diagnosed with the old version of arthas before. You can execute `stop` to stop the old version of arthas, and then reuse the new version to attach.

### The spring bean cglib object is obtained in the ognl expression, but the field is null

Reference:

- [https://github.com/alibaba/arthas/issues/1802](https://github.com/alibaba/arthas/issues/1802)
- [https://github.com/alibaba/arthas/issues/1424](https://github.com/alibaba/arthas/issues/1424)

0 comments on commit b343869

Please sign in to comment.