While looking for leaked resources (threads) after shutdown and before restart we in some cases get an assertion in the python threading module where we find a thread marked as running at the python level but it has no associated thread at the C level.