Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行bg命令后退出当前session #2985

Open
1 task done
z398552250 opened this issue Jan 18, 2025 · 0 comments
Open
1 task done

执行bg命令后退出当前session #2985

z398552250 opened this issue Jan 18, 2025 · 0 comments

Comments

@z398552250
Copy link

z398552250 commented Jan 18, 2025

  • 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: v4.0.4
  • Arthas 版本: v4.0.4
  • 操作系统版本: win11
  • 目标进程的JVM版本: jdk8
  • 执行arthas-boot的版本: v4.0.4

重现问题的步骤

  1. 执行命令: trace cn.com.beautyfarm.controller.SysUserController list &
  2. 执行命令: jobs (获取后台运行id)
  3. 执行命令: fg id号
  4. 按下按键: ctrl+z
  5. 执行命令: bg id号

期望的结果

该trace任务在后台继续运行,命令行窗口可以继续停留在arthas命令行控制界面

实际运行的结果

[10]*
       Stopped           trace cn.com.beautyfarm.controller.SysUserController list &
       execution count : 3
       start time      : Sun Jan 19 00:11:18 CST 2025
       timeout date    : Mon Jan 20 00:11:18 CST 2025
       session         : 2907be26-1e14-4812-a651-f5f78eac3b03 (current)
[arthas@10304]$ bg 10
[arthas@10304]$ [10]*
       Running           trace cn.com.beautyfarm.controller.SysUserController list &
       execution count : 3
       start time      : Sun Jan 19 00:11:18 CST 2025
       timeout date    : Mon Jan 20 00:11:18 CST 2025
       session         : 2907be26-1e14-4812-a651-f5f78eac3b03 (current)


Connection to host lost.

D:\arthas>

在发生以上问题后,我使用telnet localhost 3658 重新建立连接后, 查看jobs,任务仍在运行. 再次执行fg命令,提示:

[arthas@10304]$ jobs
[10]
       Running           trace cn.com.beautyfarm.controller.SysUserController list &
       execution count : 3
       start time      : Sun Jan 19 00:11:18 CST 2025
       timeout date    : Mon Jan 20 00:11:18 CST 2025
       session         : 2907be26-1e14-4812-a651-f5f78eac3b03
[arthas@10304]$ fg 10
job 10 doesn't belong to this session, so can not fg it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant