To reproduce:
- strace -f -p pid_of_a_slips_module
- ls -l /proc/<pid_of_a_slips_module>/fd/
you will find modules looping through FDs, listening, then timing out, etc.
this leads to unneccessary CPU usage
Cause:
When creating a redis instance in slips main.py before forking the modules, the fork copies all FDs to the children
Solution: Use a multiprocessing context that uses spawn instead of fork
import multiprocessing as mp
mp.set_start_method("spawn") # instead of fork