Alright - for not having to look it up in detail again, here’s how I recorded a thread dump (simple but effective on limited machines / java-headless installations):
Open one terminal session;
Get the PID of openhab: systemctl status openhab | grep PID
The result will look something like: Main PID: 770 (java)
In another terminal session, run: journalctl -u openhab.service -f > /var/log/openhab/threaddump.log
In the first terminal, run: sudo kill -3 <pid> with being 770 in that example
After some secs,ctrl+c in the second terminal and the dump is inside the threaddump.log file.
As the result has roughly 1M size, it would be good to know what to filter / grep for to get the interesting parts out of it!
The only “issue” I have at the moment… I don’t get the deadlock! I rebooted three times, everything up in some 5 minutes each time.
System was up for a week or so, and at that time and before, a reboot almost certainly caused a deadlock which only could be solved by a service stop - wait - start sequence.
I will keep an eye on it and if I encounter a deadlock again, I’ll provide the dump.
Thanks for documenting how you made the thread dump
Are you saying that the thread dump text file is that big? That sounds strange, what happens if you compress it? No binary/memdump files are needed, only the text file which shows what each thread is doing.
Hehe, a thread dump is only useful if the problem is there anyway, so nothing we can do about that. Have you updated to 5.0.1? Because, if you have, I don’t think you’ll experience this exact problem anymore, although some of the underlying issues remain to be solved.