From bdeef4e4ce50a3ef5b8d44351e850f5c1bc62526 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 31 Jan 2022 12:00:34 -0800 Subject: [PATCH] Add info on running jstack against gerrit to docs This is meant to help debug gerrit in some circumstances particularly now that the Java Melody plugin is not installed. Change-Id: Ifedb7abd08c7fe1281ac510c6872fe8d9fe700a1 --- doc/source/gerrit.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/source/gerrit.rst b/doc/source/gerrit.rst index c41179deef..3f1b602c2a 100644 --- a/doc/source/gerrit.rst +++ b/doc/source/gerrit.rst @@ -567,3 +567,18 @@ must follow that steps: a change, you can delete them with following query:: delete from change_messages where author_id={account-id} and change_id={change-id}; + +Generating a Thread Dump for Debugging +-------------------------------------- + +We removed the Java Melody plugin the wake of the Log4Shell vulnerability. +This removed an easy way to acquire a thread dump but dumping threads is +still possible with java command line tools. You may find yourself wanting +to do this if Gerrit is suffering from poor performance or you are trying to +debug odd Gerrit behavior. + +To run jstack and produce a thread dump do:: + + review02# docker exec -it gerrit-compose_gerrit_1 bash + gerrit@review02:/$ ps -ef | grep java # find the Gerrit java process PID + gerrit@review02:/$ jstack $PID > /tmp/dump.yearmonthday