-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Optimize retry in failbackregistry #2752
Comments
目前我们的retry会在FailbackRegistry初始化的时候进行,我们完全可以让他更加规律的执行。 现在我们有五个集合需要定期检查。更好的方式应该是在这五个集合不为空的时候再进行我们的retry。然后在集合为空的时候再停止我们的任务,以此来解约更多的资源,对整个retry流程实现更精确的控制。 这种情况下,最多我们会有五个任务在执行,最少我们不需要任何一个检查+retry的任务(当我们五个集合都为空的时候)。 |
@carryxyh 是想当集合为null的时候终止线程池吗?集合添加元素的时候新生成一个线程池吗?这样成本更高啊,还是写成订阅者模式,抛异常了自己推自己 |
线程池的使用场景和这里是不符合的。也没有必要写成SUB/PUB。我上面的描述我思考了一下我觉得不是特别好。没必要对每个集合整体检查。关于这个的设计可以一起讨论一下。 |
加一个消费者队列,来一个消费一个如何 |
我们的终极目的是让检查和retry更加符合我们的预期,预期就是每五秒钟处理一次retry操作。 |
#2763 |
Currently our retry will start executing when the FailbackRegistry starts. We can completely retry it more regularly.
At present, we have five collections that need to be checked regularly. Why not check regularly when the collection is not empty, check and retry will continue until the collection is empty. If the collection has new elements that require retry, continue to open a task.
So we need to open up to five tasks at most, at least we can do not need to retry.
The text was updated successfully, but these errors were encountered: