Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 相同的注册任务,创建不同的job参数不同,并发执行存在任务回调问题 #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ctbsea
Copy link

@ctbsea ctbsea commented Mar 8, 2022

场景
同一个jobHandle 指定不同的参数

jobHandle = xx
job 1 : 参数: param1
job 2 : 参数: param2

出现问题

job1和job2 同时执行的时候 回调只有一个能够成功

问题分析

注册: RegTask("xx", srv.XxFunc)
获取:task := e.regList.Get(param.ExecutorHandler)
job1 和 job2 同时执行的时候 , task 指向的都是同一个地址

job 1先到达执行器执行 job 1用的就是regList的task地址, 对task的 Id 等进行赋值
在job1 未执行完毕,job 2到达的时候 , job 2用的也是regList的task地址, 只是重新赋值, 覆盖了之前job 1的 id 等参数,
导致 job1 和 job2 执行成功 回调的参数都是job2 ,在xxl-job-admin的后台看到 job1 存在日志但是一直没有收到回调

@ctbsea ctbsea changed the title fix: same reg different executorParams callback bug fix: 相同的注册任务,创建不同的job参数不同,并发执行存在任务回调问题 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant