From my gdb and printf debugging I'm seeing that p2p::close() is hanging, specifically it's stuck joining all threads in the threadpool, somewhere in there something is causing some kind of deadlock. I've seen this on my production nodes, my local dev nodes on my laptop and my desktop machine, it's quite reproducible, but hard to track down
What I'm seeing after adding a bunch of debug logs is that p2p::close is being called more than once
I also see there is a potential race between threadpool::shutdown, threadpool::join and threadpool::spawn_once. The shutdown method will reset work which can be re-initialized by spawn_once and could cause join to need to wait for more work to be finished.