We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer some questions before submitting your issue. Thanks!
2.3.1
只有一台执行机的情况下,对一个单机串行的脚本任务同时发起多次执行,期望结果是发起的执行排队等待,并全部执行完
会偶发性的出现一个任务失败的情况,失败日志都是
简单创建一个powershell任务,脚本代码为: 通过多线程,接口调用该任务发起多次执行,我个人测试用机器在60次时较为容易复现该上述出错情形
个人推测是对任务线程缓存ConcurrentMap<Integer, JobThread>的复合操作导致的,推测如下 1.对同一任务发起多次执行时,由于任务线程缓存里还没有任务的线程 这段代码获取的jobThread和jobHandler都为null,则最后都会走到这一段代码,即调用registJobThread方法 此时若有多个请求任务的线程同时调用这段代码 即同时创建了多个任务线程,然后在调用jobThreadRepository.put(jobId, newJobThread)的时候,因为单个put本身是同步的, 导致先put进的任务线程会被后put的任务线程覆盖,并且被调用oldJobThread.interrupt()标志线程状态中断
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Please answer some questions before submitting your issue. Thanks!
Which version of XXL-JOB do you using?
2.3.1
Expected behavior
只有一台执行机的情况下,对一个单机串行的脚本任务同时发起多次执行,期望结果是发起的执行排队等待,并全部执行完
Actual behavior
会偶发性的出现一个任务失败的情况,失败日志都是
Steps to reproduce the behavior
简单创建一个powershell任务,脚本代码为:
通过多线程,接口调用该任务发起多次执行,我个人测试用机器在60次时较为容易复现该上述出错情形
Other information
个人推测是对任务线程缓存ConcurrentMap<Integer, JobThread>的复合操作导致的,推测如下
1.对同一任务发起多次执行时,由于任务线程缓存里还没有任务的线程
这段代码获取的jobThread和jobHandler都为null,则最后都会走到这一段代码,即调用registJobThread方法
此时若有多个请求任务的线程同时调用这段代码
即同时创建了多个任务线程,然后在调用jobThreadRepository.put(jobId, newJobThread)的时候,因为单个put本身是同步的,
导致先put进的任务线程会被后put的任务线程覆盖,并且被调用oldJobThread.interrupt()标志线程状态中断
The text was updated successfully, but these errors were encountered: