slfan1989 commented on code in PR #5636: URL: https://github.com/apache/hadoop/pull/5636#discussion_r1192144572
########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/RouterWebServiceUtil.java: ########## @@ -363,14 +363,30 @@ public static AppsInfo mergeAppsInfo(ArrayList<AppInfo> appsInfo, */ protected static Client createJerseyClient(Configuration conf) { Client client = Client.create(); - client.setConnectTimeout((int) conf - .getTimeDuration(YarnConfiguration.ROUTER_WEBAPP_CONNECT_TIMEOUT, - YarnConfiguration.DEFAULT_ROUTER_WEBAPP_CONNECT_TIMEOUT, - TimeUnit.MILLISECONDS)); - client.setReadTimeout((int) conf - .getTimeDuration(YarnConfiguration.ROUTER_WEBAPP_READ_TIMEOUT, - YarnConfiguration.DEFAULT_ROUTER_WEBAPP_READ_TIMEOUT, - TimeUnit.MILLISECONDS)); + + long connectTimeOut = conf.getTimeDuration(YarnConfiguration.ROUTER_WEBAPP_CONNECT_TIMEOUT, + YarnConfiguration.DEFAULT_ROUTER_WEBAPP_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS); + long readTimeout = conf.getTimeDuration(YarnConfiguration.ROUTER_WEBAPP_READ_TIMEOUT, Review Comment: Thank you for your help to review the code! I will modify the code. ########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestRouterWebServiceUtil.java: ########## @@ -678,4 +682,45 @@ public void testMergeDiffApplicationStatisticsInfo() { Assert.assertEquals(YarnApplicationState.FINISHED, item3Result.getState()); Assert.assertEquals(item4.getCount(), item3Result.getCount()); } + + @Test + public void testCreateJerseyClient() { + // Case1, default timeout, The default timeout is 30s. + YarnConfiguration configuration = new YarnConfiguration(); + Client client01 = RouterWebServiceUtil.createJerseyClient(configuration); + Map<String, Object> properties = client01.getProperties(); + Object readTimeOut = properties.get(ClientConfig.PROPERTY_READ_TIMEOUT); Review Comment: I will modify the code. -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org