[ 
https://issues.apache.org/jira/browse/YARN-10720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17312492#comment-17312492
 ] 

Peter Bacsko commented on YARN-10720:
-------------------------------------

{noformat}
              } catch (InterruptedException e) {
                LOG.warn("doGet() interrupted", e);
                resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
              }
              resp.setStatus(HttpServletResponse.SC_OK);
            }
{noformat}

This is not good - you set the response status to {{SC_BAD_REQUEST}} only to 
override it with {{SC_OK}}. You need a "return".

{noformat}
            try {
              servlet.init(config);
            } catch (ServletException e) {
              LOG.error(e.getMessage());
              fail("Failed to init servlet");
            }

            try {
              servlet.doGet(request, response);
            } catch (ServletException e) {
              LOG.error(e.getMessage());
              fail("ServletException thrown during doGet.");
            }
          }
{noformat}

You can remove try-catch here and just add {{throws ServletException}}. If that 
happens for whatever reason, it will be a test error (which is desired - 
checking if the servlet can init is not the purpose of the test), not a test 
failure.

> YARN WebAppProxyServlet should support connection timeout to prevent proxy 
> server hang.
> ---------------------------------------------------------------------------------------
>
>                 Key: YARN-10720
>                 URL: https://issues.apache.org/jira/browse/YARN-10720
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Qi Zhu
>            Assignee: Qi Zhu
>            Priority: Critical
>         Attachments: YARN-10720.001.patch, YARN-10720.002.patch, 
> YARN-10720.003.patch, YARN-10720.004.patch, YARN-10720.005.patch, 
> image-2021-03-29-14-04-33-776.png, image-2021-03-29-14-05-32-708.png
>
>
> Following is proxy server show, {color:#de350b}too many connections from one 
> client{color}, this caused the proxy server hang, and the yarn web can't jump 
> to web proxy.
> !image-2021-03-29-14-04-33-776.png|width=632,height=57!
> Following is the AM which is abnormal, but proxy server don't know it is 
> abnormal already, so the connections can't be closed, we should add time out 
> support in proxy server to prevent this. And one abnormal AM may cause 
> hundreds even thousands of connections, it is very heavy.
> !image-2021-03-29-14-05-32-708.png|width=669,height=101!
>  
> After i kill the abnormal AM, the proxy server become healthy. This case 
> happened many times in our production clusters, our clusters are huge, and 
> the abnormal AM will be existed in a regular case.
>  
> I will add timeout supported in web proxy server in this jira.
>  
> cc  [~pbacsko] [~ebadger] [~Jim_Brennan]  [~ztang]  [~epayne] [~gandras]  
> [~bteke]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to