Maybe the reason why I can reproduce it is because I rarely shut down the node with bitcoin-cli stop. I may just turn off my computer with Bitcoin running.
Even so, if you close your terminal or used
CTRL+C, bitcoind will try its best to cleanly shutdown.
In the former, shutdown procedure will not display but it should be gracefully shutting-down in the background, but it may get interrupted if you immediately power-off the machine.
You can always check each session in your debug.log if it's abruptly cut or it contains those usual shutdown procedures (
thread exits, wallet release, etc).
Or do you mean you're shutting-down the machine while it's running?
Anyways, this PR already have a a few reviews and will likely fix the issue:
github.com/bitcoin/bitcoin/pull/34897