]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: exception pickle: don't raise
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 14 Feb 2020 14:35:39 +0000 (15:35 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 18 Feb 2020 12:08:00 +0000 (13:08 +0100)
Otherwiese the pickle exception hides the underlying root cause.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/orchestrator/_interface.py

index ba5284b034b9b0356688da1f2699f81e226e07df..e6915b9c0a349b66bba911679b63b352f7fb508c 100644 (file)
@@ -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):