Finalize
- class nvidia_resiliency_ext.inprocess.finalize.Finalize[source]
Abstract base class for
finalizeargument forinprocess.Wrapper.Finalizebrings 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
Finalizeshould 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.Finalizeclass is executed after a fault was detected, distributed group was destroyed, but before theinprocess.health_check.HealthCheckis performed.Multiple instances of
Finalizecould be composed withinprocess.Composeto achieve the desired behavior.
- class nvidia_resiliency_ext.inprocess.finalize.ThreadedFinalize(timeout, fn, args=(), kwargs=None)[source]
Executes the provided finalize
fnfunction with specified positional and keyword arguments in a separatethreading.Thread.Raises an exception if execution takes longer than the specified
timeout.