Skip to content

Instantly share code, notes, and snippets.

@wstrange
Created August 3, 2018 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wstrange/49b7bf471317c6cafd9d6fbaa95db890 to your computer and use it in GitHub Desktop.
Save wstrange/49b7bf471317c6cafd9d6fbaa95db890 to your computer and use it in GitHub Desktop.
Debug running ds processes with jstack
#!/usr/bin/env bash
dump() {
echo "******* Dump $1 *******"
pid=`jps -ml | grep $1 | awk '{print $1}'`
if [ -n "$pid" ]; then
echo $pid
jstack $pid;
fi
}
while true
do
echo "******** Thread dump *******"
jps -ml
dump Directory
dump ReplicationCliMain
sleep 30;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment