-
Notifications
You must be signed in to change notification settings - Fork 191
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
Ensure that stacktrace is included in transport task exceptions #2986
Ensure that stacktrace is included in transport task exceptions #2986
Conversation
When a transport task of a calculation job excepts, the expontential back off retry wrapper calls the logger of the process node with the exception. This will trigger the `DbLogHandler` such that the log message is entered into the database with a link to the process node. However, only the message was included and not the stack trace which made it difficult to determine the cause from `verdi process report`. To fix this, in the `Log.objects.create_from_record` we attempt to format a traceback from the `exc_info` if it is included in the record which will be the case for an exception log. This commit also fixes a bug in the `ProcessLauncher._continue` method that was calling the `create_future` method of the communicator, which has long been removed. Instead a normal future should just be created.
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.
thanks @sphuber !
just 2 minor requests
aiida/engine/utils.py
Outdated
@@ -180,13 +180,15 @@ def exponential_backoff_retry(fct, initial_interval=10.0, max_attempts=5, logger | |||
if ignore_exceptions is not None and isinstance(exception, ignore_exceptions): | |||
raise | |||
|
|||
count = iteration + 1 | |||
core_name = coro.__name__ |
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.
should this be coro_name
?
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.
absolutely, done
@@ -180,13 +180,15 @@ def exponential_backoff_retry(fct, initial_interval=10.0, max_attempts=5, logger | |||
if ignore_exceptions is not None and isinstance(exception, ignore_exceptions): |
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.
ignore_exceptions seems to be missing a docstring. Can you add one?
It's not self-evident that "ignoring exceptions" means re-rasing them
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.
Done
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.
thanks @sphuber !
thanks for the review @ltalirz |
Fixes #2898 and fixes #2984
When a transport task of a calculation job excepts, the exponential
back off retry wrapper calls the logger of the process node with the
exception. This will trigger the
DbLogHandler
such that the logmessage is entered into the database with a link to the process node.
However, only the message was included and not the stack trace which
made it difficult to determine the cause from
verdi process report
.To fix this, in the
Log.objects.create_from_record
we attempt toformat a traceback from the
exc_info
if it is included in the recordwhich will be the case for an exception log.
This commit also fixes a bug in the
ProcessLauncher._continue
methodthat was calling the
create_future
method of the communicator, whichhas long been removed. Instead a normal future should just be created.