Actions
Task #4321
openIdea #3795: [Crunch/SDKs] Tasks need more retry support
[SDK] PySDK should arrange exit(111) when a temporary failure exception is uncaught
Status:
New
Priority:
Normal
Assigned To:
-
Target version:
-
Description
By default, Python exits 1 when there's any uncaught exception. We should introspect these for exceptions that represent temporary failures (KeepReadError but not its subclasses, KeepWriteError), and arrange to exit 111 when they're uncaught, to signal to Crunch that the task can be retried.
We can do this by defining sys.excepthook
, although it will take a little care to avoid interfering with other scripts that set this. Suggest:
def arvados_excepthook(exc_type, exc_value, traceback):
# Write traceback, do introspection, exit here.
if sys.excepthook is sys.__excepthook__:
sys.excepthook = arvados_excepthook
No data to display
Actions