Finalize
- class nvidia_resiliency_ext.inprocess.finalize.Finalize[source]
Abstract base class for
finalize
argument forinprocess.Wrapper
.Finalize
brings the process into a state where a restart of the wrapped function may be attempted, e.g.: deinitialize any global variables or synchronize with any asynchronous tasks issued by the wrapped function that was not already performed by exception handlers in the wrapped function.Any failure during execution of
Finalize
should raise an exception. In this case the health check is skipped, exception is reraised by the wrapper, and it should cause termination of the main Python interpreter process.Finalize
class is executed after a fault was detected, distributed group was destroyed, but before theinprocess.health_check.HealthCheck
is performed.Multiple instances of
Finalize
could be composed withinprocess.Compose
to achieve the desired behavior.
- class nvidia_resiliency_ext.inprocess.finalize.ThreadedFinalize(timeout, fn, args=(), kwargs=None)[source]
Executes the provided finalize
fn
function with specified positional and keyword arguments in a separatethreading.Thread
.Raises an exception if execution takes longer than the specified
timeout
.