From 5368b6917e2902728289cbd22ebf860c9410d893 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Tue, 26 Feb 2019 10:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=99=A8=E4=BC=98=E9=9B=85?= =?UTF-8?q?=E5=81=9C=E6=9C=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 1 + .../xxl/job/core/executor/XxlJobExecutor.java | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index def460fd..25ccbd6d 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1430,6 +1430,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 16、LRU路由更新不及时问题修复; - 17、任务失败告警邮件发送逻辑优化; - 18、调度日志排序逻辑调整为按照调度时间倒序,兼容TIDB等主键不连续日志存储组件; +- 19、执行器优雅停机优化; - 19、[迭代中]任务线程隔离: - 执行器测异步响应,不存在阻塞不需要隔离; - 调度中心共用单一调度线程池,可能导致调度阻塞需要线程隔离;调度线程池拆分为Fast/Slow两个,针对调度较慢的执行器地址请求,降级使用Slow线程池;考虑是否可以任务级隔离线程池; diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java b/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java index e58e102a..84f1f9e7 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java @@ -69,7 +69,7 @@ public class XxlJobExecutor { // init logpath XxlJobFileAppender.initLogPath(logPath); - // init admin-client + // init invoker, admin-client initAdminBizList(adminAddresses, accessToken); @@ -103,6 +103,9 @@ public class XxlJobExecutor { // destory executor-server stopRpcProvider(); + + // destory invoker + stopInvokerFactory(); } @@ -139,6 +142,14 @@ public class XxlJobExecutor { } } } + private void stopInvokerFactory(){ + // stop invoker factory + try { + XxlRpcInvokerFactory.getInstance().stop(); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } public static List getAdminBizList(){ return adminBizList; } @@ -202,12 +213,6 @@ public class XxlJobExecutor { } private void stopRpcProvider() { - // stop invoker factory - try { - XxlRpcInvokerFactory.getInstance().stop(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } // stop provider factory try { xxlRpcProviderFactory.stop();