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

Jobs with attempts > 0 have different priority? #1755

Closed
DavideViolante opened this issue May 29, 2020 · 7 comments · Fixed by #2737
Closed

Jobs with attempts > 0 have different priority? #1755

DavideViolante opened this issue May 29, 2020 · 7 comments · Fixed by #2737

Comments

@DavideViolante
Copy link
Contributor

DavideViolante commented May 29, 2020

Description

I noticed the following in our app:

  1. there are X+Y jobs in waiting queue: X jobs have priority 50 and attemps 0, Y jobs have priority 25 and attemps > 0
  2. the jobs with priority 50 go into the active queue BEFORE the jobs with priority 25

I was expecting that jobs with priority 25 go before the other ones with priority 50, even if the ones with priority 25 have attempted once or more.
Which is the correct behaviour?

Bull version

v3.14.0

@manast
Copy link
Member

manast commented May 31, 2020

It probably has not do with the number of attempts, but rather with the retry. I found an issue in the retry script that is moving jobs back to the wait queue but ignoring the priority.

@manast manast added the bug label May 31, 2020
@DavideViolante
Copy link
Contributor Author

DavideViolante commented Jun 4, 2020

Is there a date when this is going to be addressed?
Is there a previous version that is not affected? I remeber this was not happening in the past if I remember correctly, but absolutely not sure.
If I'm wrong, is there a way to force programmatically the waiting jobs priority 25 attempts>0 to go into active queue before others?
Thanks

@manast
Copy link
Member

manast commented Jun 4, 2020

I cannot give a date. But PRs are welcome of course.
I do not think this is a regression because the code for it is missing, likewise the unit tests.

@DavideViolante
Copy link
Contributor Author

Ok thanks.
Do you think using the delay field applied to the X jobs (priority 50) can be a good workaround to prioritize the Y jobs (priority 25)?

@manast
Copy link
Member

manast commented Jun 4, 2020

maybe works for your use case, there may be edge cases where it does not work as you expect.

@DavideViolante
Copy link
Contributor Author

I tried it and it seems it doesn't work with delay either.
Waiting for a fix.

@stale stale bot added the wontfix label Jul 12, 2021
@manast manast removed the wontfix label Jul 13, 2021
@OptimalBits OptimalBits deleted a comment from stale bot Jul 13, 2021
github-actions bot pushed a commit that referenced this issue May 15, 2024
## [4.12.4](v4.12.3...v4.12.4) (2024-05-15)

### Bug Fixes

* **retry-job:** consider priority ([#2737](#2737)) fixes [#1755](#1755) ([09ce146](09ce146))
@manast
Copy link
Member

manast commented May 15, 2024

🎉 This issue has been resolved in version 4.12.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants