summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-06-19 09:52:56 +0000
committerJürg Billeter <j@bitron.ch>2019-06-19 09:52:56 +0000
commit9d593e1f3449dc8f24fb6855264f78882b182e3c (patch)
tree7e36f9abac0f269e7f4508baa6a683eec55e077d
parentdd57aab55b786e92b9d93c3ec3c8121e57ab73fe (diff)
parent07b3dc5f98cfd75cff97c815f6abb854d1e5436c (diff)
downloadbuildstream-9d593e1f3449dc8f24fb6855264f78882b182e3c.tar.gz
Merge branch 'juerg/grpc' into 'master'
Guard against gRPC channels in the main process See merge request BuildStream/buildstream!1405
-rw-r--r--src/buildstream/_cas/casremote.py3
-rw-r--r--src/buildstream/sandbox/_sandboxremote.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/buildstream/_cas/casremote.py b/src/buildstream/_cas/casremote.py
index aac0d2802..cd46e9c38 100644
--- a/src/buildstream/_cas/casremote.py
+++ b/src/buildstream/_cas/casremote.py
@@ -94,6 +94,9 @@ class CASRemote():
def init(self):
if not self._initialized:
+ # gRPC doesn't support fork without exec, which is used in the main process.
+ assert not utils._is_main_process()
+
url = urlparse(self.spec.url)
if url.scheme == 'http':
port = url.port or 80
diff --git a/src/buildstream/sandbox/_sandboxremote.py b/src/buildstream/sandbox/_sandboxremote.py
index 2cb7e2538..d90b164bc 100644
--- a/src/buildstream/sandbox/_sandboxremote.py
+++ b/src/buildstream/sandbox/_sandboxremote.py
@@ -60,6 +60,9 @@ class SandboxRemote(Sandbox):
if config is None:
return
+ # gRPC doesn't support fork without exec, which is used in the main process.
+ assert not utils._is_main_process()
+
self.storage_url = config.storage_service['url']
self.exec_url = config.exec_service['url']