How and when to capture the thread dump of the Spark driver?

brickster_2018
Databricks Employee
Databricks Employee

What is the best way to capture the thread dump of the Spark driver process. Also, when should I capture the thread dump?