-
Notifications
You must be signed in to change notification settings - Fork 69
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
Order SolidQueue failed executuions by id desc #114
base: main
Are you sure you want to change the base?
Order SolidQueue failed executuions by id desc #114
Conversation
@@ -198,6 +198,7 @@ def order_executions(executions) | |||
case | |||
# Follow polling order for scheduled executions, the rest by job_id, desc or asc | |||
when solid_queue_status.scheduled? then executions.ordered | |||
when solid_queue_status.failed? then executions.order(created_at: :desc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a good index for this, so this won't work in general in the case you have many failed jobs 🤔 We'll need a good index first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, indeed !
happy to help on this point, but I'm not sure of the process, especially to provide migrations to end users through an update, does it necessarily have to be done through a generator like the install migrations ?
Sorry for the delay on this one, I was busy with other stuff. I kept thinking about it, though, and added a comment with an alternative idea in rails/solid_queue#207 (comment). Let me know what you think! |
@rosa I'm trying to make the specs pass, I'm having an issue on the Since it's used for both resque and solid queue (and potentially new adapters down the road) the behavior it tests has to be the same. Right now it's (indirectly) testing the order of failed jobs, if I adapt the tests to pass for solid queue they will fail for resque, and it doesn't seem to be easy to have resque return the list of failed jobs in a descending order. I tried to change the spec to use finished jobs instead but it seems than once the jobs are performed on resque the Do you have any pointers ? Also many other specs are failing but I haven't looked at them yet |
Ahhh, that makes sense. I think that should be doable for the Resque adapter, changing how this works. The offset would need to be applied relative to the end of the list, combined with the I understand this is a bit out of scope for this PR, although arguably, we'd have a consistent ordering across adapters 🤔
Yeah, Resque doesn't store finished jobs anywhere, and the adapter doesn't support the I think a temporary solution could be that each adapter test could declare the order for failed jobs The best solution would be to make Resque and Solid Queue behave in the same way, I think 🤔 |
Thanks for the pointers. You're right, the behaviour should be the same for all adapters. I'll try to look into it in the next days |
Thank you so much! No worries if you don't have time to do this, it was supposed to be a tiny change! I'm happy to work on it myself, possibly in a week or so, as I must work on other stuff this week, but I'll get to it! 😊 |
When inspecting the failed jobs, I want to see in an instant the most recent ones.
This seems to be the default in Sidekiq and GoodJob AFAICS.
I was very surprised to see that this was not the case with mission control + solid queue, it actually made me miss some important dead jobs that were hidden in page 2.
This PR changes the ordering of failed executions so they are ordered by (failed execution)
creationID DESC.