-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
时间轮有并发问题,极端情况下丢失调度 #2877
Comments
这个代码确实是会有并发问题存在 |
这里的并发问题,具体指什么呢?比如是使用的容器不具备线程安全性,还是某段操作不具备原子性 |
代码逻辑是会补偿1s之前的调度。就算在同一秒内,先remove,再push,丢失了这一次的调度,在下一秒同样可以补偿到上一秒丢失的调度。 如果还是没有补偿到,那么在下一个5s将会立即进行一次调度。 |
如果MisfireStrategy是不处理过期任务,还是会丢任务 |
这里的确有问题 |
认真看了下无论MisfireStrategy是什么都会有问题,进缓存之前就更新了时间了 |
This was referenced Jan 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一个线程向时间轮添加,一个线程删除,并发问题
The text was updated successfully, but these errors were encountered: