-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
[BUG] - Scheduler with LimitModeWait and Job Singleton mode with LimitModeReschedule - Job Queues up if Scheduler limit reached #722
Comments
I hit this as well. Think it is the same as - #706 What is happening is that https://github.com/go-co-op/gocron/blob/v2/executor.go#L306 sends out for reschedule The job doesn't have to be slow, you can return inside the duration and jobs still accumulate |
@bearrito I think it is two different issue.If you use WithLimitConcurrentJobs with scheduler then job is not run by singletonModeRunner, but issue maybe related |
I think your right, I missed that. In this case https://github.com/go-co-op/gocron/blob/v2/executor.go#L99 and are both rescheduling |
I've got #723 up to solve the memory issue with the duplicate rescheduling that was going on. As to this particular issue, what's happening makes sense with the current design:
I had originally designed it not thinking that the two modes would be used concurrently, but I see now that there are valid reasons to do so. As such, this will need some refactoring. Essentially, the logic in https://github.com/go-co-op/gocron/blob/v2.3.0/executor.go#L241-L267 will need to be moved up to https://github.com/go-co-op/gocron/blob/v2.3.0/executor.go#L129-L135 and that will need to be tested / investigated for any unintended consequences. |
This issue happening is rare.Since I don't see a use case were both will be used concurrently(maybe it may change later or others might have this use case). |
adding a comment in d808cd9 |
Describe the bug
Scheduler with LimitModeWait and Job Singleton mode with LimitModeReschedule - Job Queues up if Scheduler limit reached
To Reproduce
Output:
Version
Latest
Expected behaviour
If Scheduler with LimitModeWait limit is reached and Job is singleton with LimitModeReschedule then it should reschedule immediately
Additional context
If one job is slow it will hog the queue
The text was updated successfully, but these errors were encountered: