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

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

Thanks [~zhuqi] for the patch.

1. As you said {{ExpectedException.none()}} has been deprecated. Either use the 
new {{assertThrows()}} or {{@Test(expected = SocketTimeoutException.class)}}, I 
think using the second is easier.

2.
{noformat}
            conf.setInt(YarnConfiguration.RM_PROXY_CONNECTION_TIMEOUT,
                1 * 1000);
{noformat}
Just write "1000" instead of "1 * 1000".

3.
{noformat}
            try {
              when(response.getOutputStream()).thenReturn(null);
            } catch (IOException e) {
              e.printStackTrace();
            }
{noformat}
Unnecessary try-catch block. The method already has a {{throws}} clause.

4.
{noformat}
            @Override
            protected void doGet(HttpServletRequest req, HttpServletResponse 
resp)
                throws ServletException, IOException {
              try {
                Thread.sleep(10 * 1000);
              } catch (InterruptedException e) {
                e.printStackTrace();
              }
              resp.setStatus(HttpServletResponse.SC_OK);
            }
{noformat}
Maybe a minor thing, but if you catch {{InterruptedException}}, don't just 
print the stack trace, log it with {{LOG.warn("doGet() interrupted", e)}}. In 
this case, I'd also return with {{HttpServletResponse.SC_BAD_REQUEST}}.

5. 
 {{<description>The web proxy connection timeout, default is 60s(60 * 
1000ms).</description>}}

This already goes to {{yarn-default.xml}}, so you can omit the part "default is 
60s(60 * 1000ms)" and just write "The web proxy connection timeout".

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