diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java index 63a5739417..9c3f9971d8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java @@ -230,6 +230,9 @@ public void init(String userName) { this.executorService = new ThreadPoolExecutor(numMinThreads, numMaxThreads, keepAliveTime, TimeUnit.MILLISECONDS, workQueue, threadFactory); + // Adding this line so that unused user threads will exit and be cleaned up if idle for too long + this.executorService.allowCoreThreadTimeOut(true); + final Configuration conf = this.getConf(); try {