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

当设置isMonitorExecution=true后,等待积压任务应该能够设置timeout #49

Closed
gl2001wl opened this issue Feb 29, 2016 · 5 comments
Labels

Comments

@gl2001wl
Copy link
Contributor

当设置isMonitorExecution=true后:
while (executionService.hasRunningItems()) {
log.debug("Elastic job: sleep short time until other job completed.");
BlockUtils.waitingShortTime();
}
当任务由于某些原因阻塞的话,后面的任务仍然会依次启动并进入等待队列,最坏的情况可能出现stackOverFlowException。
应当提供可选配置等待timeout,达到后退出while循环并报警。

@terrymanu
Copy link
Member

目前quartz设定的是用1个线程池
result.put("org.quartz.threadPool.threadCount", "1");
代码在JobScheduler, 162行
作业不会同时启动,如果上个作业未完成下个作业不会启动,只是会记录misfire。
这样会否存在你说的stackOverFlowException的可能

@duanbin
Copy link

duanbin commented Nov 22, 2016

我看代码misfire应该是分片维度的,不是调度批次维度的,如果2台机器【1,2】,【3,4】,第一次调度后【1,2】数据少执行较快,【3,4】数据较多执行较慢,达到第二次调度时间时可能上次【3,4】还没执行完,这时候第二次调度的时候【1,2】会继续运行,但是【3,4】设置了misfire

@terrymanu
Copy link
Member

是的,是担心一个分片执行不完整个下次作业都不能执行。如果想讨论misfire的事情,可以另开启一个issue

@1594433168
Copy link

while (executionService.hasRunningItems()) {
log.debug("Elastic job: sleep short time until other job completed.");
BlockUtils.waitingShortTime();
}
假设上一个job,因为ConnectionLoss异常,调用jobFacade.registerJobCompleted失败,导致没有清空sharding/running下的临时节点,但因为不会会话超时,所以临时节点一直存在,那么下一个job将会在这个while中死循环

@terrymanu
Copy link
Member

Expired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants