Created
October 1, 2020 18:00
-
-
Save onderkalaci/65096be40bf6258c98c94c12db4481d5 to your computer and use it in GitHub Desktop.
attach process running in docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- find the PID of the process that is blocked, you can use pg_stat_activity or anything else | |
| -- we'll use PID in the next steps | |
| -- assume that we find it as 6939 | |
| -- the PID we have is running on docker | |
| -- now, find the corresponding PID of the process on the VM | |
| for i in $(ps -ef | grep `docker inspect --format '{{.State.Pid}}' PostgreSQLCitus` | awk '{print $2}') ; do grep NSpid: /proc/$i/status ; done | grep 6939 | |
| NSpid: 26857 6939 | |
| -- use gdb to connect to the PID on the VM | |
| gdb -p 26857 | |
| (gdb) bt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment