xxl-job icon indicating copy to clipboard operation
xxl-job copied to clipboard

xxl-job-admin集群部署会重复执行调度任务吗?

Open cwtree opened this issue 3 years ago • 4 comments

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

2.3.0

Expected behavior

xxl-job-admin集群多台部署的时候,怎么控制任务不会重复执行的?

任何都是xxl-job-admin去调度的,多个xxl-job-admin怎么保证不会重复调度执行的? 具体原理或者源码在哪?

Actual behavior

容器部署多台xxl-job-admin

Steps to reproduce the behavior

no

Other information

no

cwtree avatar Oct 18 '21 03:10 cwtree

通过 xxl_job_lock 的排它锁控制每个时间段只有一台机器在读取任务列表

zhuzhenting avatar Oct 18 '21 11:10 zhuzhenting

select * from xxl_job_lock where lock_name = 'schedule_lock' for update 通过xxl_job_lock这个表控制的,每次只会有一台机器执行调度任务

liuchunhe2021 avatar Oct 23 '21 08:10 liuchunhe2021

官方文档写着集群下小概率会出现重复调度情况,而且我们项目中也出现了

syu723 avatar Nov 04 '22 09:11 syu723

2.30版本不是说已经修复了,我们项目也出现了

yanhua-volvo avatar Jan 26 '24 03:01 yanhua-volvo