Skip to content
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

Job#moveToCompleted on delayed job moves it to active #64

Closed
jamesholcomb opened this issue Nov 7, 2019 · 6 comments
Closed

Job#moveToCompleted on delayed job moves it to active #64

jamesholcomb opened this issue Nov 7, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@jamesholcomb
Copy link

jamesholcomb commented Nov 7, 2019

When I add a job to a queue with a long delay (e.g. 60s), then subsequently call moveToCompleted before the delay has passed, the job goes active and is executed by the QueueScheduler.

My current workaround is to Job#remove but I would rather keep the history of all jobs.

Is this by design?

@manast manast added the bug Something isn't working label Nov 7, 2019
@manast
Copy link
Contributor

manast commented Nov 7, 2019

ok, so I think we overlook moveToCompleted, it is not taking into consideration that the job could be in the delayed status. So it moves the job to the completed set, but since it is also still in the delayed set it will execute when the delayed time is over.

@roggervalf
Copy link
Collaborator

@jamesholcomb you can try last version, now moveToCompleted throw an error if you try to move to completed if the job is not in active state

@jamesholcomb
Copy link
Author

Can you summarize the changes that were made? It's been a while since I looked at this particular issue.

@roggervalf
Copy link
Collaborator

sure, now moveToCompleted verifies when deleting the job from active key, if that record was deleted or not, in case it was not deleted because there wasn't one, it throws an error that says that the actual job was not in active state, so job is not moved to completed, so now we should make sure that the job is in active state before moving it to completed state being aware of this

@manast
Copy link
Contributor

manast commented Apr 21, 2021

So I think we could close this issue now?

@jamesholcomb
Copy link
Author

Thanks @roggervalf. I reviewed my code and do not utilize moveToCompleted any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants