diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-04-02 13:22:51 +0100 |
---|---|---|
committer | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-05-23 15:49:10 +0100 |
commit | 684c1b96da60360439565bed405eb3228ab5ce3b (patch) | |
tree | 6ef0c8adb59059775423537e3eeab07ffc1811a5 | |
parent | 728220753f9e694dc761bac46b178d9640cb1b45 (diff) | |
download | buildstream-684c1b96da60360439565bed405eb3228ab5ce3b.tar.gz |
TEMP: MultiprocessingPdb, traceback in Job._child_action
-rw-r--r-- | src/buildstream/_scheduler/jobs/elementjob.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/buildstream/_scheduler/jobs/elementjob.py b/src/buildstream/_scheduler/jobs/elementjob.py index a6842352e..ca1927336 100644 --- a/src/buildstream/_scheduler/jobs/elementjob.py +++ b/src/buildstream/_scheduler/jobs/elementjob.py @@ -91,6 +91,18 @@ def make_element_from_picklable_element_state(state): print("Unpickled element", element, repr(element)) return element +import sys +import pdb + +class MultiprocessingPdb(pdb.Pdb): + def interaction(self, *args, **kwargs): + _stdin = sys.stdin + try: + sys.stdin = open('/dev/stdin') + pdb.Pdb.interaction(self, *args, **kwargs) + finally: + sys.stdin = _stdin + # ElementJob() # # A job to run an element's commands. When this job is spawned @@ -184,7 +196,15 @@ class ChildElementJob(ChildJob): detail=env_dump) # Run the action - return self._action_cb(self._element) + # MultiprocessingPdb().set_trace() + try: + result = self._action_cb(self._element) + except Exception as e: + print(e) + import traceback + traceback.print_exc() + raise + return result def child_process_data(self): data = {} |