summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <bschubert15@bloomberg.net>2020-12-05 16:21:48 +0000
committerBenjamin Schubert <bschubert15@bloomberg.net>2020-12-05 16:21:48 +0000
commitded144e97de4c6bb4c211204761b0104e437df29 (patch)
treeadd31bc29668845999b1c41d10c16f2a0bfddca9
parent79d1eca85a59a2e6ecda4eac536f70d7178d8736 (diff)
downloadbuildstream-ded144e97de4c6bb4c211204761b0104e437df29.tar.gz
job.py: Stop sending errors through the child-parent pipe, and set it directly
Since we run in a single process, we do not need this distinction anymore
-rw-r--r--src/buildstream/_scheduler/jobs/job.py25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py
index 3fde4148d..322849a79 100644
--- a/src/buildstream/_scheduler/jobs/job.py
+++ b/src/buildstream/_scheduler/jobs/job.py
@@ -72,7 +72,6 @@ class _Envelope:
class _MessageType(FastEnum):
LOG_MESSAGE = 1
- ERROR = 2
# Job()
@@ -383,11 +382,6 @@ class Job:
# Propagate received messages from children
# back through the context.
self._messenger.message(envelope.message)
- elif envelope.message_type is _MessageType.ERROR:
- # For regression tests only, save the last error domain / reason
- # reported from a child task in the main process, this global state
- # is currently managed in _exceptions.py
- set_last_task_error(envelope.message["domain"], envelope.message["reason"])
else:
assert False, "Unhandled message type '{}': {}".format(envelope.message_type, envelope.message)
@@ -577,7 +571,7 @@ class ChildJob:
)
# Report the exception to the parent (for internal testing purposes)
- self._child_send_error(e)
+ set_last_task_error(e.domain, e.reason)
# Set return code based on whether or not the error was temporary.
#
@@ -648,23 +642,6 @@ class ChildJob:
def _send_message(self, message_type, message_data):
self._pipe_w.send(_Envelope(message_type, message_data))
- # _child_send_error()
- #
- # Sends an error to the main process through the message pipe
- #
- # Args:
- # e (Exception): The error to send
- #
- def _child_send_error(self, e):
- domain = None
- reason = None
-
- if isinstance(e, BstError):
- domain = e.domain
- reason = e.reason
-
- self._send_message(_MessageType.ERROR, {"domain": domain, "reason": reason})
-
# _child_message_handler()
#
# A Context delegate for handling messages, this replaces the