You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exceptions should be reraised using the three-argument raise syntax:
raiseexc_class, exc_instance, traceback
E.g.:
raise_Timeout, _Timeout(e), sys.exc_info()[2]
In cases where the exception is thrown in one thread and reraised in another thread, the first thread must make sure to pass on both the exception object and the traceback, found at sys.exc_info()[2].
The text was updated successfully, but these errors were encountered:
I would suggest changing the future.py code to pass around (value, exc_info) instead of just value. This seems more robust than assuming that any value that is an exception should be raised. Looking at other code bases that handle this type of re-raise issues there seem to be some gotchas here with respect to circular loops created by data in the traceback that you will probably have to avoid.
This issue was reported by @adamcik at IRC after review of the Pykka source code.
At https://github.com/jodal/pykka/blob/master/pykka/gevent.py#L37 a
gevent.Timeout
exceptions is reraised wrapped in apykka.Timeout
exception. This reraise does not keep the traceback of the original exception.At https://github.com/jodal/pykka/blob/master/pykka/future.py#L93 a exception thrown in a
ThreadingActor
is reraised in the thread of a consumer of aThreadingFuture
. This reraise does not keep the traceback of the original exception.The exceptions should be reraised using the three-argument
raise
syntax:E.g.:
In cases where the exception is thrown in one thread and reraised in another thread, the first thread must make sure to pass on both the exception object and the traceback, found at
sys.exc_info()[2]
.The text was updated successfully, but these errors were encountered: