summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-10-04 17:35:02 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-10-04 17:36:00 +0000
commit2b9e6f5b7b9ef39a01bac170d565e5184f0d9574 (patch)
treead24e5c3d23e654430a3f6fdaeef9e098f5a71b7
parent2516668ba2ad23b7149c73f2aac485603cb71536 (diff)
downloadbuildstream-2b9e6f5b7b9ef39a01bac170d565e5184f0d9574.tar.gz
cascache.py: Block SIGINT in the buildbox-casd process
We don't want SIGINT to be forwarded to the buildbox-casd process, otherwise it would get killed if someone CTRL+C the BuildStream process and then continues the build, which would make everything fail.
-rw-r--r--src/buildstream/_cas/cascache.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 43375c635..80ff87a9e 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -37,7 +37,7 @@ from .._protos.google.rpc import code_pb2
from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc
from .._protos.build.buildgrid import local_cas_pb2, local_cas_pb2_grpc
-from .. import utils
+from .. import _signals, utils
from .._exceptions import CASCacheError
from .._message import Message, MessageType
@@ -91,8 +91,11 @@ class CASCache():
self.casd_logfile = self._rotate_and_get_next_logfile()
with open(self.casd_logfile, "w") as logfile_fp:
- self._casd_process = subprocess.Popen(
- casd_args, cwd=path, stdout=logfile_fp, stderr=subprocess.STDOUT)
+ # Block SIGINT on buildbox-casd, we don't need to stop it
+ # The frontend will take care of it if needed
+ with _signals.blocked([signal.SIGINT], ignore=False):
+ self._casd_process = subprocess.Popen(
+ casd_args, cwd=path, stdout=logfile_fp, stderr=subprocess.STDOUT)
else:
self._casd_process = None