Class ReplayExceptionClient
A plugin for the client allowing replay of remote exceptions locally
Declaration
class ReplayExceptionClient
source linkDocumentation
Adds the following methods (and their async variants)to the given client:
- ``recreate_error_locally``: main user method
- ``get_futures_error``: gets the task, its details and dependencies,
responsible for failure of the given future.
Methods
▶ def get_futures_error(self, future) Ask the scheduler details of the sub-task of the given failed future
When a future evaluates to a status of "error", i.e., an exception
was raised in a task within its graph, we an get information from
the scheduler. This function gets the details of the specific task
that raised the exception and led to the error, but does not fetch
data from the cluster or execute the function.
Parameters
Returns
See also
ReplayExceptionClient.recreate_error_locally
▶ def recreate_error_locally(self, future) For a failed calculation, perform the blamed task locally for debugging.
This operation should be performed after a future (result of ``gather``,
``compute``, etc) comes back with a status of "error", if the stack-
trace is not informative enough to diagnose the problem. The specific
task (part of the graph pointing to the future) responsible for the
error will be fetched from the scheduler, together with the values of
its inputs. The function will then be executed, so that ``pdb`` can
be used for debugging.
Parameters
Returns
- Nothing; the function runs and should raise an exception, allowing
Examples
>>> future = c.submit(div, 1, 0) # doctest: +SKIP
>>> future.status # doctest: +SKIP
'error'
>>> c.recreate_error_locally(future) # doctest: +SKIP
ZeroDivisionError: division by zero
If you're in IPython you might take this opportunity to use pdb
>>> %pdb # doctest: +SKIP
Automatic pdb calling has been turned ON
>>> c.recreate_error_locally(future) # doctest: +SKIP
ZeroDivisionError: division by zero
1 def div(x, y):
----> 2 return x / y
ipdb>
@property
def scheduler(self)