8000 增加work节点状态,标识只是不接收新任务 · Issue #1094 · PowerJob/PowerJob · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

增加work节点状态,标识只是不接收新任务 #1094

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

Open
libra1010 opened this issue Apr 23, 2025 · 1 comment
Open

增加work节点状态,标识只是不接收新任务 #1094

libra1010 opened this issue Apr 23, 2025 · 1 comment
Labels
new feature new feature

Comments

@libra1010
Copy link

增加work节点状态,标识只是不接收新任务
已接收的任务正常执行,不收影响,可能是个长任务,耗时1H这种的任务
work java代码提供修改此状态的代码,提供stop 和 resume 用于不接收新任务以及恢复任务接收

@libra1010 libra1010 added the new feature new feature label Apr 23, 2025
@libra1010
Copy link
Author

Class clazz = powerJobSpringWorker.getClass();
var field = clazz.getDeclaredField("powerJobWorker");
field.setAccessible(true);
var worker = (PowerJobWorker) field.get(powerJobSpringWorker);
var workerClass = worker.getClass();
var engine = workerClass.getDeclaredField("remoteEngine");
engine.setAccessible(true);
var remoteEngine = (RemoteEngine) engine.get(worker);
remoteEngine.close();

我使用了如上代码试图达到这个需求。在实践中发现还是有问题
节点是下线了,但是运行中的任务数量一直没有减少
任务数量是使用了计数器, try final 来进行计数的
最终一直没有进入final 所以应该是和 server 断联, 然后 直接 线程终止了?
所以还是希望增加一个这个功能
用于发版时的长任务不中断, 比如我们有同步任务,一般这种同步任务会进行30分钟- 几个小时不等

Image

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

No branches or pull requests

1 participant
0