Comments (3)
由于各个任务是分布式的,由于各个服务器有时间差,无法保证主节点一定最先执行。
如果从节点先于主节点执行,会发生init方法还没有执行的问题,从节点作业就运行的问题。
改为主节点不执行,其他节点阻塞,有2个问题:
- 吞吐量下降
- 如何判断主节点在本次作业中是否执行过。因为作业循环往复,本次执行结束和下次执行开始在分布式环境下无法区分
欢迎讨论,
如果可以有方法实现让主节点一定优先于从节点执行的方法,这个issue才可以继续做。
from shardingsphere-elasticjob.
1、每个任务完成之后写zk,分片任务写多个节点,leader监听父节点,所有任务都完成则设置任务完成的标记位。
2‘、在后置任务中指定前置任务,后置任务到达执行时间的时候,先检测前置任务是否执行完毕,如果没有执行完毕,则等待一定的时间。
2‘’,在后置任务中指定前置任务,前置任务完成之后,发送通知驱动后置任务启动。
2‘’‘,在后置任务中制定前置任务,后置任务监听前置任务创建的zk节点,前置任务设置任务完成的标记位时,后置任务的watcher收到通知,后置任务启动。
@terrymanu 不知以上方案是否可行,请百忙中参考一下~ :)
刚开始读代码~不知道最近能否实现以上方案,并pull request~
from shardingsphere-elasticjob.
任务依赖,之前使用quartz自己的listener实现的,前置自动触发后置的
from shardingsphere-elasticjob.
Related Issues (20)
- SnakeYAML 2.1+ is not compatible with ElasticJob Lite HOT 4
- Supports building project via JDK21 HOT 1
- version 3.0.2+ cause Spring's transaction to fail. HOT 1
- [DISCUSS] Release Plan of ElasticJob 3.0.4 HOT 1
- version 2.1.5 控制台很卡,查不出数据来,如何解决? HOT 2
- Dependency not found :elasticjob-spring-boot-starter HOT 1
- 服务重启后,控制台任务都是已下线的怎么办,而且正常调度结束的任务后台也查询不到
- 定时任务提前执行
- zk集群删除无效数据 HOT 1
- elasticjob 可以计划去掉Zookeeper吗,就像高版本kafka去掉Zookeeper一样? HOT 2
- Unit test `DefaultJobClassNameProviderTest#assertGetLambdaJobName` fails on OpenJDK 21 HOT 1
- 动态创建任务服务重启后未过时的任务可以重新启动吗?
- Elastic-job 有没有任务队列功能?如果有那怎么控制最大注册任务并发数量?
- Does Elastic-job support task queues? If yes, how to control the maximum number of concurrent registration tasks in queue?
- Q: How to set jobs configuration dynamically from database?
- When the ZooKeeper leader node restarts or the ZooKeeper process freezes, the session expires. There is a possibility that the instance enters the shutdown state. As a result, the instance node scheduling stops. The instance node can be restored only by restarting the instance node.
- jobShardingStrategyType: ROUND_ROBIN is not available
- 任务正常跑一段时间,突然某个任务不再执行,版本2.1.5 HOT 1
- Are there any plans to support grayscale tasks?
- 在使用elasticjob-lite-spring-boot-starter开发手动触发任务时,报错,找不到指定的bean
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shardingsphere-elasticjob.