-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Consume job_explanation
from runner, fix error reporting error
#13482
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -431,16 +431,16 @@ def _run_internal(self, receptor_ctl): | |
# massive, only ask for last 1000 bytes | ||
startpos = max(stdout_size - 1000, 0) | ||
resultsock, resultfile = receptor_ctl.get_work_results(self.unit_id, startpos=startpos, return_socket=True, return_sockfile=True) | ||
resultsock.setblocking(False) # this makes resultfile reads non blocking | ||
lines = resultfile.readlines() | ||
receptor_output = b"".join(lines).decode() | ||
if receptor_output: | ||
self.task.runner_callback.delay_update(result_traceback=receptor_output) | ||
self.task.runner_callback.delay_update(result_traceback=f'Worker output:\n{receptor_output}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My plan here, now, is that ansible-runner will write the line to |
||
elif detail: | ||
self.task.runner_callback.delay_update(result_traceback=detail) | ||
self.task.runner_callback.delay_update(result_traceback=f'Receptor detail:\n{detail}') | ||
else: | ||
logger.warning(f'No result details or output from {self.task.instance.log_format}, status:\n{state_name}') | ||
except Exception: | ||
logger.exception(f'Work results error from job id={self.task.instance.id} work_unit={self.task.instance.work_unit_id}') | ||
gamuniz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
raise RuntimeError(detail) | ||
|
||
return res | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
recent discussion is that I might delete
resultsock.setblocking(False)