xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.46k stars 10.86k forks source link

优雅停机destroy方法执行顺序问题&RegisterGroup缓存了已注销的执行器 #1106

Closed WEIZIBIN closed 5 years ago

WEIZIBIN commented 5 years ago

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

master&2.1.0

Expected behavior

第一个问题: 优雅停机期望的执行顺序: 1.停止接受新任务调度stopRpcProvider() 2.中止正在运行中的任务removeJobThread() 3.推送执行结果到admin并关闭推送线程TriggerCallbackThread.getInstance().toStop() 4.销毁client invoker stopInvokerFactory()

第二个问题:优雅停机前,发送rpc请求注销该机器的调度地址,立即在xxl_job_group表中剔除停机的执行器地址

Actual behavior

优雅停机实际执行顺序: 1.中止正在运行中的任务removeJobThread() 2.推送执行结果到admin并关闭推送线程TriggerCallbackThread.getInstance().toStop() 3.销毁client invoker stopInvokerFactory() 4.停止接受新任务调度stopRpcProvider()

优雅停机后,发送rpc请求注销该机器的调度地址,更新了xxl_job_registe表,但没有立即在xxl_job_group表中剔除停机的客户端地址,导致新任务调度时,很可能调度到已经停机的执行器

Steps to reproduce the behavior

1.启动admin 2.启动xxl-job-executor-sample-springboot 3.优雅停机xxl-job-executor-sample-springboot 4.查看admin执行器列表OnLine机器还存有已停机的执行器 5.触发DemoJobHandler,直接调度到已停机的执行器

Other information

个人修复的PR #1105

chiqian2020 commented 5 years ago

我也想参与这个项目,怎么加入呢

---原始邮件--- 发件人: "许雪里"<notifications@github.com> 发送时间: 2019年9月26日 19:54:30 收件人: "xuxueli/xxl-job"<xxl-job@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: Re: [xuxueli/xxl-job] 优雅停机destroy方法执行顺序问题&RegisterGroup缓存了已注销的执行器 (#1106)

Closed #1106 via #1105.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.