abstractdog commented on code in PR #512:
URL: https://github.com/apache/tez/pull/512#discussion_r3467380759
##########
tez-plugins/tez-aux-services/src/main/java/org/apache/tez/auxservices/ShuffleHandler.java:
##########
@@ -1053,6 +1053,30 @@ private void handleRequest(ChannelHandlerContext ctx,
HttpRequest request)
"\n dagId: " + dagIdQ +
"\n keepAlive: " + keepAliveParam);
}
+ // Authenticate delete requests before execution
+ boolean isDeleteRequest = notEmptyAndContains(dagCompletedQ, "delete")
+ || notEmptyAndContains(vertexCompletedQ, "delete")
+ || notEmptyAndContains(taskAttemptFailedQ, "delete");
+ if (isDeleteRequest) {
+ if (jobQ == null || jobQ.isEmpty()) {
+ sendError(ctx, "Missing job parameter for delete request",
BAD_REQUEST);
+ return;
+ }
+ final String deleteReqUri = request.getUri();
+ if (deleteReqUri == null) {
+ sendError(ctx, FORBIDDEN);
+ return;
+ }
+ HttpResponse deleteResponse = new DefaultHttpResponse(HTTP_1_1, OK);
Review Comment:
this response is not used outside of the verifyRequest scope (right?), so no
need to declare it here separately
--
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]