summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-10-04 17:36:18 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-10-04 17:36:00 +0000
commit5615bb4d577f5f0f3055c4ad2f636d5c46435660 (patch)
tree147e3118332e3875a1cbbd3feb21e598b7eb7a65
parent2b9e6f5b7b9ef39a01bac170d565e5184f0d9574 (diff)
downloadbuildstream-5615bb4d577f5f0f3055c4ad2f636d5c46435660.tar.gz
cascache.py: Block SIGINT in the CasUsageMonitor process
We don't want this process to be killed if someones CTRL+C BuildStream and the continues the build. We can therefore just ignore SIGINT there.
-rw-r--r--src/buildstream/_cas/cascache.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 80ff87a9e..a62bc3d44 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -1088,8 +1088,11 @@ class _CASCacheUsageMonitor:
# This can't be allowed with background threads or open gRPC channels.
assert utils._is_single_threaded() and not cas.has_open_grpc_channels()
- self._subprocess = multiprocessing.Process(target=self._subprocess_run)
- self._subprocess.start()
+ # Block SIGINT, we don't want to kill the process when we interrupt the frontend
+ # and this process if very lightweight.
+ with _signals.blocked([signal.SIGINT], ignore=False):
+ self._subprocess = multiprocessing.Process(target=self._subprocess_run)
+ self._subprocess.start()
def get_cache_usage(self):
disk_usage = self._disk_usage.value