Skip to content
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

Send back PUID on response #1460

Closed
adriangonz opened this issue Feb 18, 2020 · 2 comments
Closed

Send back PUID on response #1460

adriangonz opened this issue Feb 18, 2020 · 2 comments

Comments

@adriangonz
Copy link
Contributor

adriangonz commented Feb 18, 2020

The executor generates a Prediction UID (PUID) which is forwarded down to the predictor services. However, it doesn't send this back on the final response. This UID could be useful for the end-user.

Suggested fix

It seems that, at "response time" (i.e. right before sending it back), the PUID is still present in the Go context. Therefore, the problem seems to be that the respondWithSuccess method in rest.SeldonRestApi doesn't serialise it.

func (r *SeldonRestApi) respondWithSuccess(w http.ResponseWriter, code int, payload payload.SeldonPayload) {
w.Header().Set("Content-Type", payload.GetContentType())
w.WriteHeader(code)
err := r.Client.Marshall(w, payload)
if err != nil {
r.Log.Error(err, "Failed to write response")
}
}

Adding there a w.WriteHeader() writing the PUID should be enough.

@adriangonz adriangonz added the triage Needs to be triaged and prioritised accordingly label Feb 18, 2020
@adriangonz
Copy link
Contributor Author

@cliveseldon would there be any other changes required for the gRPC endpoint?

@ukclivecox ukclivecox removed the triage Needs to be triaged and prioritised accordingly label Feb 20, 2020
@ukclivecox ukclivecox added this to the 1.2 milestone Feb 20, 2020
@ukclivecox ukclivecox removed this from the 1.2 milestone Apr 23, 2020
@ukclivecox
Copy link
Contributor

Closing this as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants