From fc6b3f37f173fd19e5a2593b7bf8cce40f03c615 Mon Sep 17 00:00:00 2001 From: Chandan Singh Date: Mon, 21 Oct 2019 14:38:07 +0100 Subject: _scheduler/scheduler.py: Enforce SafeChildWatcher In Python 3.8, `ThreadedChildWatcher` is the default watcher that causes issues with our scheduler. Enforce use of `SafeChildWatcher`. --- buildstream/_scheduler/scheduler.py | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- cgit v1.2.1