difin commented on code in PR #281:
URL: https://github.com/apache/tez/pull/281#discussion_r1165528112


##########
tez-common/src/main/java/org/apache/tez/common/web/ProfileServlet.java:
##########
@@ -196,18 +197,28 @@ public void doGet(HttpServletRequest request, 
HttpServletResponse response) thro
     final Integer height = getInteger(request, "height", null);
     final Double minwidth = getMinWidth(request);
     final boolean reverse = request.getParameterMap().containsKey("reverse");
+    final String method = request.getParameter("method");
+
+    if (request.getParameter("event") != null && method != null) {
+      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+      setResponseHeader(response);
+      response.getWriter().write("Event and method aren't allowed to be both 
used in the same request.");
+      return;
+    }
+    
     if (process == null || !process.isAlive()) {
       try {
         int lockTimeoutSecs = 3;
         if (profilerLock.tryLock(lockTimeoutSecs, TimeUnit.SECONDS)) {
           try {
             File outputFile = new File(OUTPUT_DIR,
-                "async-prof-pid-" + pid + "-" + event.name().toLowerCase() + 
"-" + ID_GEN.incrementAndGet() + "."
+                "async-prof-pid-" + pid + "-" 

Review Comment:
   Thanks for review, @abstractdog!
   Removed the whitespace.



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