distributed 2021.10.0

ParametersReturns
recreate_error_locally(self, future)

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

future : future or collection that failed

The same thing as was given to gather , but came back with an exception/stack-trace. Can also be a (persisted) dask collection containing any errored futures.

Returns

Nothing; the function runs and should raise an exception, allowing
the debugger to run.

For a failed calculation, perform the blamed task locally for debugging.

Examples

This example is valid syntax, but we were not able to check execution
>>> future = c.submit(div, 1, 0)         # doctest: +SKIP
... future.status # doctest: +SKIP 'error'
This example is valid syntax, but we were not able to check execution
>>> c.recreate_error_locally(future)     # doctest: +SKIP
ZeroDivisionError: division by zero

If you're in IPython you might take this opportunity to use pdb

This example does not not appear to be valid Python Syntax
>>> %pdb                                 # doctest: +SKIP
Automatic pdb calling has been turned ON
This example is valid syntax, but we were not able to check execution
>>> c.recreate_error_locally(future)     # doctest: +SKIP
ZeroDivisionError: division by zero
      1 def div(x, y):
----> 2     return x / y
ipdb>
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /distributed/recreate_tasks.py#159
type: <class 'function'>
Commit: