summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_scheduler/scheduler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/buildstream/_scheduler/scheduler.py b/buildstream/_scheduler/scheduler.py
index 101faccce..131cbb1d5 100644
--- a/buildstream/_scheduler/scheduler.py
+++ b/buildstream/_scheduler/scheduler.py
@@ -137,6 +137,12 @@ class Scheduler():
# Hold on to the queues to process
self.queues = queues
+ # NOTE: Enforce use of `SafeChildWatcher` as we generally don't want
+ # background threads.
+ # In Python 3.8+, `ThreadedChildWatcher` is the default watcher, and
+ # not `SafeChildWatcher`.
+ asyncio.set_child_watcher(asyncio.SafeChildWatcher())
+
# Ensure that we have a fresh new event loop, in case we want
# to run another test in this thread.
self.loop = asyncio.new_event_loop()