Updated Debugging (markdown)

Christian Schwarz 2019-09-13 15:10:21 +02:00
parent f8541dfeef
commit 451fe87299

@ -1,8 +1,12 @@
## Memory Leaks & Goroutine Leaks
A good example for a goroutine & memory leak caused by not draining a channel is
[3bfe0c16d0233cac66a01a6f89959c34ef01c663](https://github.com/zrepl/zrepl/commit/3bfe0c16d0233cac66a01a6f89959c34ef01c663d) ("rpc/dataconn/stream: fix goroutine leaks & transitive buffer leaks")
Good exapmles for situations where the following instructions helped with debugging:
* goroutine & memory leak caused by not draining a channel is
[3bfe0c16d0233cac66a01a6f89959c34ef01c663](https://github.com/zrepl/zrepl/commit/3bfe0c16d0233cac66a01a6f89959c34ef01c663d) ("rpc/dataconn/stream: fix goroutine leaks & transitive buffer leaks")
* follow up [ffea0241622e885617d8536c9c2e60c7b2248c28](https://github.com/zrepl/zrepl/commit/ffea0241622e885617d8536c9c2e60c7b2248c28)
### Instructions
1. Run zrepl with autostarted pprof server on port `:12345` and prometheus endpoint on `:22345`
* configure prometheus endpoint in [config]( https://zrepl.github.io/configuration/monitoring.html?highlight=prometheus#prometheus-grafana)
* `zrepl pprof on :12345` if the daemon is already running (for example when we want to capture a rare deadlock which would be resolved by restarting the daemon)