-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up scopes and exception handling for new tasks #543
Conversation
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #543 +/- ##
==========================================
+ Coverage 85.37% 85.44% +0.07%
==========================================
Files 371 371
Lines 28722 28857 +135
Branches 2310 2310
==========================================
+ Hits 24520 24658 +138
+ Misses 3563 3561 -2
+ Partials 639 638 -1
Continue to review full report at Codecov.
|
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: wild-endeavor <[email protected]>
outputs = task_def.dispatch_execute(ctx, idl_input_literals) | ||
# Decorate the dispatch execute function before calling it, this wraps all exceptions into one | ||
# of the FlyteScopedExceptions | ||
outputs = _scoped_exceptions.system_entry_point(task_def.dispatch_execute)(ctx, idl_input_literals) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg, this is weird?
why not a simple
try:
outputs = ....
except :
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is effectively what the decorator does. The reason the decorator exists is mostly for two reasons:
- We enter and leave user-code in multiple places,
- The excpetions that we, flytekit authors, throw do not conform to any hierarchy easily distinguishable from potential user exceptions. After we complete [Housekeeping] [flytekit] Exception cleanup flyte#1033, and all flytekit exceptions have a base class that users will never use, we can get rid of these scoped exceptions and just use a few try catches to distinguish things.
I think it's preferable to get rid of these scoped exceptions actually, I just don't want to go through everything and update them right now. Maybe at 1.0
the last case in the nested try/catch below. | ||
|
||
Decorator for wrapping functions that enter a system context. This should decorate every method that may invoke some | ||
user code later on down the line. This will allow us to add differentiation between what is a user error and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user code later on down the line. This will allow us to add differentiation between what is a
WHY not at the point where the user code is called? i.e. only the last parent of the user code function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just couple stylistic comments
TL;DR
This cleans up the exception handling of new tasks and workflows. Currently there is no differentiation of recoverable or non-recoverable errors and all errors were system errors.
Type
Are all requirements met?
Complete description
kind
into theExecutionError
model.origin
into theContainerError
._dispatch_execute
in the entrypoint.py.