You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/04/22 23:59:41 UTC

[GitHub] [incubator-yunikorn-core] yangwwei commented on a change in pull request #267: [YUNIKORN-645] Metrics endpoint doesn't export any metrics

yangwwei commented on a change in pull request #267:
URL: https://github.com/apache/incubator-yunikorn-core/pull/267#discussion_r618826128



##########
File path: pkg/webservice/webservice.go
##########
@@ -81,7 +81,7 @@ type YResponseWriter struct {
 
 func (rw *YResponseWriter) Write(bytes []byte) (int, error) {
 	rw.body = bytes
-	if rw.statusCode == -1 {
+	if rw.statusCode == -1 || rw.statusCode == http.StatusOK {

Review comment:
       This seems to fix the problem we saw here, but this line could still cause issues.
   For example, what if we get some other HTTP code defined in https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. Such as `Accepted`, `Created`, etc.  This will still skip writing the body to the client-side, which is dangerous. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org