From c296889d0705846fc248e02c3e8f1dc25bb5edd7 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 14 Feb 2020 15:35:39 +0100 Subject: [PATCH] mgr/orchestrator: exception pickle: don't raise Otherwiese the pickle exception hides the underlying root cause. Signed-off-by: Sebastian Wagner --- src/pybind/mgr/orchestrator/_interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index ba5284b034b9b..e6915b9c0a349 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -243,7 +243,11 @@ class _Promise(object): @_exception.setter def _exception(self, e): self._exception_ = e - self._serialized_exception_ = pickle.dumps(e) if e is not None else None + try: + self._serialized_exception_ = pickle.dumps(e) if e is not None else None + except Exception: + logger.exception("failed to pickle {}".format(e)) + # We can't properly raise anything here. Just hope for the best. @property def _serialized_exception(self): -- 2.39.5