bitcoin-dev-project / warnet

Monitor and analyze the emergent behaviors of Bitcoin networks
https://warnet.dev
MIT License
84 stars 36 forks source link

clean up crashed scenarios #394

Closed pinheadmz closed 2 months ago

pinheadmz commented 3 months ago

Just looking at htop inside the rpc-0 container im seeing processes listed from scenarios that are not showing as "active". I think we need to .join() those scenario threads when they either crash or finish.

mplsgrant commented 3 months ago

I imagine this is the logging thread that's creating the stranded processes.

I'm going to add a handle to the logging thread onto the process dict, and join it in scenarios_stop

mplsgrant commented 2 months ago

I have not had a chance to test this, but it gives an idea of what I'm thinking in terms of cleaning up the logging thread: https://github.com/bitcoin-dev-project/warnet/compare/main...mplsgrant:warnet:2024-07-process-context

pinheadmz commented 2 months ago

I'm actually not able to faithfully reproduce this anymore. Starting scenarios with --invalid_options or using run-file with a file with syntax errors or using scenarios stop, all threads disappear appropriately in htop. Going to close for now until I see it again