craigcondit commented on code in PR #589:
URL: https://github.com/apache/yunikorn-core/pull/589#discussion_r1262839934


##########
pkg/webservice/handlers.go:
##########
@@ -869,3 +891,90 @@ func getGroupResourceUsage(w http.ResponseWriter, r 
*http.Request) {
                buildJSONErrorResponse(w, err.Error(), 
http.StatusInternalServerError)
        }
 }
+
+func getEventsByType(w http.ResponseWriter, r *http.Request) {

Review Comment:
   I think this may be problematic. Since we filter after retrieving a page of 
results, there's no way for the client to know what ID to request next (a 
filtered page will look the same as the last page with < {pageSize} entries). 
It may be better to have the clients do their own filtering. Alternatively, we 
need to provide metadata in the response of each ID along with its associated 
message. Otherwise it's impossible for a client to reliably interpret the 
results.



##########
pkg/webservice/handlers.go:
##########
@@ -869,3 +891,90 @@ func getGroupResourceUsage(w http.ResponseWriter, r 
*http.Request) {
                buildJSONErrorResponse(w, err.Error(), 
http.StatusInternalServerError)
        }
 }
+
+func getEventsByType(w http.ResponseWriter, r *http.Request) {

Review Comment:
   Also, this could catastrophically fail if all results were filtered out. 
Imagine if ID 1-1000 are all of the wrong type; the client would request a page 
of 1000 entries starting with entry 1, and interpret the empty result as 
end-of-stream. On the next request, it would re-request the same ID and get the 
same results, leading to deadlock.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to