-
Notifications
You must be signed in to change notification settings - Fork 199
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
Render a root-cause exception for dependency and join errors #3717
Conversation
was removed in #1773 then bad reintroduced into taskrecord as part of mypy work
…his still shows the error correctly
…or-rendering Conflicts: parsl/app/futures.py parsl/dataflow/errors.py
…or-rendering' into benc-dependency-error-rendering
…or-rendering Conflicts: parsl/dataflow/dflow.py
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 will be a good addition, I think; nice polish.
assert isinstance(id_txt, str) | ||
# if there are several causes for this exception, label that |
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.
The typing wasn't enough for Mypy? Heh.
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 came originally from catching real mis-usage of this exception in non-statically-checked parts of the code, where an integer was being passed in (the task id integer) rather than a string, and not being found. because it's deep inside a complex structure, typeguard can't do runtime checks either.
Description
This PR reworks two exception types, DependencyError and JoinError. Both of these exceptions report that a task failed because some other task/future failed - in the dependency case, because a task dependency failed, and in the join case because one of the tasks/futures being joined failed.
This PR introduces a common superclass
PropagatedException
to acknowledge that the meaning and behaviour of these two exceptions is very similar.PropagatedException
has a new implementation for reporting the failures that are being propagated. Parsl has tried a couple of ways to do this in the past:The implementation immediately before this PR reports only the immediate task IDs (or future reprs, for non-tasks) in the exception message. For details of the chain of exceptions and original/non-propagated exception, the user can examine the exception object via the
dependent_exceptions_tids
attribute.Prior to PR Make dependency exceptions only report task ID, not full exception tree #1802, the repr/str (and so the printed form) of dependency exceptions rendered the entire exception. In the case of deep dependency chains or where a dependency graph has many paths to a root cause, this resulted in extremely voluminous output with a lot of boiler plate dependency exception text.
The approach introduced by this current PR attempts a fusion of these two approaches:
(+ others)
__cause__
magic attribute which is usually populated byraise e1 from e2
. This PR populates that magic attribute at construction so that displaying the exception will show the cause using Python's native format.dependent_exceptions_tids
attribute for such introspection.A dependency or join error is now rendered by Python as exactly two exceptions next to each other:
Changed Behaviour
DependencyErrors and JoinErrors will render differently
Type of change