-
Notifications
You must be signed in to change notification settings - Fork 361
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
Give more detail when we cannot process a non-JSON streamed line #1186
Conversation
@@ -244,8 +244,11 @@ def run(self): | |||
try: | |||
line = self._input.readline() | |||
data = json.loads(line) | |||
except (json.decoder.JSONDecodeError, IOError): | |||
self.status_callback({'status': 'error', 'job_explanation': 'Failed to JSON parse a line from worker stream.'}) | |||
except (json.decoder.JSONDecodeError, IOError) as exc: |
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.
@AlanCoding Thanks for the patch. Could you please add a test for this change?
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.
Sorry for the delay. I agree.
I just pushed a change where I modified some existing tests. There was effectively already coverage, but I added more detail to the assertions.
Pack the line information into job_explanation for technical reasons Limit line length in these error messages to print to 1000 characters Update tests to check for more error reporting
959180e
to
dd4403e
Compare
Thanks. Backport PRs are requested ( |
Right now I would say "no" to a 2.3 backport. There are a number of error-handling related fixes, and I don't think this would be the most major. |
…ible#1186) Pack the line information into job_explanation for technical reasons Limit line length in these error messages to print to 1000 characters Update tests to check for more error reporting
…) (#1258) Pack the line information into job_explanation for technical reasons Limit line length in these error messages to print to 1000 characters Update tests to check for more error reporting
The error handling for this in AWX has been really unforgivably bad. This abuses
result_traceback
somewhat, but this practice already existed in AWX. More information is better than less, is the main idea I'm following here.