scheduler.py: Prevent the asyncio loop from leaking into subprocesses
Description
Having a running asyncio loop while forking a program is not supported in python and doesn't work as expected.
This leads to file descriptors leaking and the subprocesses sharing the same loop as the parents. This also leads to the parent receiving all signals the children receive.
This ensures we don't leek our asyncio loop in the workers we fork.
Validating the change
- add
assert False
at https://gitlab.com/BuildStream/buildstream/blob/master/src/buildstream/_scheduler/scheduler.py#L496 - ctrl-c twice once the pipeline is running
- Compare with master
Benchmarks
!1692 (merged)
Benchmarks for the whole changes can be found onEdited by Benjamin Schubert