Agent Thread Dump
It is recommended that you take an agent thread dump from the Web UI: go to the Agent page, Agent Summary tab, and use the Dump threads on agent action.
If the UI is not accessible, you can take the dump thread manually:
Under Windows
You have several options:
- Use the TeamCity-bundled thread dump tool (can be found in the agent's plugins). Run the command:
<TeamCity agent>\plugins\stacktracesPlugin\bin\x86\JetBrains.TeamCity.Injector.exe <pid_of_java_process> |
Note that if the hanging process is run as a service, the server or the agent process must be run from a console with elevated permissions (using Run as Administrator). If the service is run under System account, you might also need to launch the thread dumping tools via "PsExec.exe -s <path to the tool>\<tool> <options>"
Under Linux
- run jstack <pid_of_java_process> (using jstack from the same JVM as used by the application) or kill -3 <pid_of_java_process>. In the latter case output will appear in <TeamCity server home>/logs/catalina.out or <TeamCity agent home>/logs/error.log
Note that the TeamCity agent consists of two java processes: the launcher and agent itself. The agent is triggered by the launcher. You will usually be interested in the agent (nested) process and not the launcher one.
Please sign in to leave a comment.