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

Hangfire Dequeueing Order #23

Open
jeansimoncollard opened this issue Nov 5, 2018 · 5 comments
Open

Hangfire Dequeueing Order #23

jeansimoncollard opened this issue Nov 5, 2018 · 5 comments

Comments

@jeansimoncollard
Copy link

We have more hangfire jobs than our system can process, so they pile up in a queue that never empties completely.

We've noticed that the oldest jobs never get executed. It's only the newly created jobs that do. I started looking in the code and found the code referenced below. If I understand correctly, jobs are processed in descending order (last in first out). Is this normal? I know Hangfire is FIFO by default if we use SQL.

Thank you in advance,
Jean-Simon Collard

@perrich
Copy link
Owner

perrich commented Nov 24, 2018

You've right.
The order has been defined like this because others plugins use the same order before my first commit... So, seems to be an old choice.

I'll change the order.

Thanks.

@jeansimoncollard
Copy link
Author

Thank you,

I am also unsure if the date represented by "q.AddedAt" is the moment at which the job was enqueued or the moment at which the job was first created. According to the behavior, it looks like it is the time at which the job was created.

@DominicRich
Copy link

Any news on when this change might happen? I too found this issue and have been working around it by queuing x high priority jobs and then queuing the rest with the highest priority last. My queue does clear so I don't have the same issue as @jeansimoncollard but this behaviour is frustrating.
I've been using this in production without issue (it is just used for a cache warm up so non-essential) so thanks for this.

@perrich
Copy link
Owner

perrich commented Jan 15, 2019

Not easy as it seems. I've rollbacked my local changes :(.
Please contribute if you want a fix.

@DominicRich
Copy link

Ah. I assumed it would be a quick fix. I'll try and take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants