summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2019-10-21 14:38:07 +0100
committerChandan Singh <csingh43@bloomberg.net>2019-12-23 15:39:17 +0000
commit05550426d4afe92854f7a53bc18f8b715dd04693 (patch)
tree00dd5f5c26cdab44c0e6f717b9d140cc07299ff4
parent0a9a9c2b2837968dee09e7ab6519200f146db612 (diff)
downloadbuildstream-05550426d4afe92854f7a53bc18f8b715dd04693.tar.gz
WIP: Enforce SafeChildWatcher
-rw-r--r--src/buildstream/_scheduler/scheduler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index a45da82f9..ca7e9279c 100644
--- a/src/buildstream/_scheduler/scheduler.py
+++ b/src/buildstream/_scheduler/scheduler.py
@@ -171,6 +171,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()