You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 07:14:58 UTC

[buildstream] 03/04: WIP: Enforce SafeChildWatcher

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch chandan/testpy38
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 05550426d4afe92854f7a53bc18f8b715dd04693
Author: Chandan Singh <cs...@bloomberg.net>
AuthorDate: Mon Oct 21 14:38:07 2019 +0100

    WIP: Enforce SafeChildWatcher
---
 src/buildstream/_scheduler/scheduler.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index a45da82..ca7e927 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()