-
Notifications
You must be signed in to change notification settings - Fork 59
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
(maint) Update task blocking response to return all results #639
Conversation
In the task response, return exitcode and stderr as well as stdout. This allows a consumer to skip querying status, as all the data they need for a task is in the response. The status query used to retrieve task results returns stdout, stderr, and exitcode. This makes the response to running a task - which is returned immediately upon completion, rather than in response to a status request - contain the same information so a controller can avoid a follow-up request to get it.
ba4253d
to
a47bb91
Compare
CLA signed by all contributors. |
|
@nicklewis did you have any more thoughts on this? |
No, I think it makes sense to me. |
result.set("stdout", output); | ||
} | ||
if (!response.output.std_err.empty()) { | ||
result.set("stderr", response.output.std_err); |
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 we sanitize this to ensure it is valid UTF-8?
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.
Would also want to do that in the else clause. Maybe, but I'm tempted to say it's unlikely we'll get binary data on stderr.
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.
Fair enough.
In the task response, return exitcode and stderr as well as stdout. This
allows a consumer to skip querying status, as all the data they need for
a task is in the response.
The status query used to retrieve task results returns stdout, stderr,
and exitcode. This makes the response to running a task - which is
returned immediately upon completion, rather than in response to a
status request - contain the same information so a controller can avoid
a follow-up request to get it.