You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:44:40 UTC
[buildstream] 14/17: Lint fixes
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a commit to branch tpollard/buildsubprocess
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 67b6c8cef8f8e13b1125bd1db557f3110b32a66b
Author: Tom Pollard <to...@codethink.co.uk>
AuthorDate: Tue Oct 29 12:52:27 2019 +0000
Lint fixes
---
setup.cfg | 2 +-
src/buildstream/_scheduler/scheduler.py | 2 +-
src/buildstream/_stream.py | 5 +++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/setup.cfg b/setup.cfg
index 3637586..78b4fb7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -30,7 +30,7 @@ warn_no_return = True
# Ignore missing stubs for third-party packages.
# In future, these should be re-enabled if/when stubs for them become available.
-[mypy-copyreg,arpy,grpc,pluginbase,psutil,py,pyroaring,pytest,_pytest.*,ruamel]
+[mypy-copyreg,arpy,grpc,pluginbase,psutil,py,pyroaring,pytest,_pytest.*,ruamel,tblib]
ignore_missing_imports=True
# Ignore missing stubs for Cythonized modules.
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index 931e976..1d7c041 100644
--- a/src/buildstream/_scheduler/scheduler.py
+++ b/src/buildstream/_scheduler/scheduler.py
@@ -25,7 +25,6 @@ import asyncio
from itertools import chain
import signal
import datetime
-import queue
# Local imports
from .resources import Resources
@@ -214,6 +213,7 @@ class Scheduler:
if not subprocessed:
self._casd_process = casd_process_manager.process
_watcher = asyncio.get_child_watcher()
+
def abort_casd(pid, returncode):
self.loop.call_soon(self._abort_on_casd_failure, pid, returncode)
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index f63cdaf..b622676 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -20,7 +20,6 @@
# Tristan Maat <tr...@codethink.co.uk>
import asyncio
-import functools
import multiprocessing as mp
import os
import sys
@@ -29,7 +28,6 @@ import shlex
import shutil
import tarfile
import tempfile
-import queue
import signal
from contextlib import contextmanager, suppress
from fnmatch import fnmatch
@@ -70,6 +68,7 @@ from .plugin import Plugin
from . import utils, _yaml, _site, _signals
from . import Scope
+
# Stream()
#
# This is the main, toplevel calling interface in BuildStream core.
@@ -1821,8 +1820,10 @@ class Stream:
self._casd_process = self._context.get_cascache().get_casd_process_manager().process
self._watcher = asyncio.get_child_watcher()
self._watcher.attach_loop(self.loop)
+
def abort_casd(pid, returncode):
self.loop.call_soon(self._abort_on_casd_failure, pid, returncode)
+
self._watcher.add_child_handler(self._casd_process.pid, abort_casd)
def _abort_on_casd_failure(self, pid, returncode):