Commit 461b6a80 authored by Jack Zhang's avatar Jack Zhang Committed by Facebook GitHub Bot
Browse files

Fix instrument_checkpoint swallow exception

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/593

ContextDecorator won't raise exception in `__exit__`. We have to manually re-raise it. Otherwise, the exception will be silently discarded.

Reviewed By: wat3rBro

Differential Revision: D47454999

fbshipit-source-id: 44b1884543206202036f588eebe23cf61974982b
parent e4fa6d63
...@@ -33,4 +33,9 @@ class instrument_checkpoint(ContextDecorator): ...@@ -33,4 +33,9 @@ class instrument_checkpoint(ContextDecorator):
unique_id=self.unique_id, unique_id=self.unique_id,
state="end", state="end",
) )
if exc_value is not None:
# Re-raising the exception, otherwise it will be swallowed
raise exc_value
return True return True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment