Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.4.0
-
Reviewed
Description
YARN-8529. Add timeout to RouterWebServiceUtil#invokeRMWebService.
This JIRA only considers the case of Create InterceptorChain, and initializes the client in the DefaultRequestInterceptorREST#init method
@Override public void init(String user) { webAppAddress = WebAppUtils.getRMWebAppURLWithScheme(getConf()); client = RouterWebServiceUtil.createJerseyClient(getConf()); }
However, FederationInterceptorREST#createInterceptorForSubCluster will create DefaultRequestInterceptorREST of different SubClusters. This part does not initialize the Client, resulting in NPE when calling.
private DefaultRequestInterceptorREST createInterceptorForSubCluster( SubClusterId subClusterId, String webAppAddress) { final Configuration conf = this.getConf(); String interceptorClassName = conf.get( YarnConfiguration.ROUTER_WEBAPP_DEFAULT_INTERCEPTOR_CLASS, YarnConfiguration.DEFAULT_ROUTER_WEBAPP_DEFAULT_INTERCEPTOR_CLASS); DefaultRequestInterceptorREST interceptorInstance = null; try { Class<?> interceptorClass = conf.getClassByName(interceptorClassName); if (DefaultRequestInterceptorREST.class .isAssignableFrom(interceptorClass)) { interceptorInstance = (DefaultRequestInterceptorREST) ReflectionUtils .newInstance(interceptorClass, conf); } else { throw new YarnRuntimeException( "Class: " + interceptorClassName + " not instance of " + DefaultRequestInterceptorREST.class.getCanonicalName()); } } catch (ClassNotFoundException e) { throw new YarnRuntimeException( "Could not instantiate ApplicationMasterRequestInterceptor: " + interceptorClassName, e); } String webAppAddresswithScheme = WebAppUtils.getHttpSchemePrefix(this.getConf()) + webAppAddress; interceptorInstance.setWebAppAddress(webAppAddresswithScheme); interceptorInstance.setSubClusterId(subClusterId); // Missing initialization DefaultRequestInterceptorREST#Client Code interceptors.put(subClusterId, interceptorInstance); return interceptorInstance; }
Attachments
Issue Links
- links to