-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix issues related to rq job dependencies #7139
Conversation
… job registry due to AbandonedJobError
cvat/settings/base.py
Outdated
|
||
return job_ids | ||
|
||
rq.registry.StartedJobRegistry.cleanup = custom_started_job_registry_cleanup |
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.
Please add a comment why we need override this method, and also add a link to the relevant issue
060ca0c
to
70de4ab
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #7139 +/- ##
===========================================
+ Coverage 81.48% 81.54% +0.05%
===========================================
Files 364 365 +1
Lines 39883 39923 +40
Branches 3702 3703 +1
===========================================
+ Hits 32499 32554 +55
+ Misses 7384 7369 -15
|
Could you add a changelog entry? |
|
||
# NOTE: we should patch implementation of original method because | ||
# there is no enqueuing dependent jobs in original function | ||
# https://github.com/rq/rq/issues/2006 |
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.
Since you already have a fix, maybe you could submit it upstream? That way we could potentially remove this hack later (or maybe not apply it in the first place, depending on how quickly the maintainers respond).
This PR resolves 2 issues related to rq jobs: 1. In some scenarios it is possible to reach a situation when `X2` rq job depends on `X1` -> running `X1` job is moved to FailedJobRegistry and not deleted -> user creates one more `X1` job that is enqueued after `X2` execution. It was possible due to the second issue when a user tried to export annotations for task 1, then for task 2, and after restarting the worker container user tried again to export annotations for task 1. (cyclic dependence) 2. Looks like in rq implementation rq jobs that depend on `X` job will never be enqueued when `X` is moved to FailedJobRegistry due to AbandonedJobError. I've submitted the [issue](rq/rq#2006) to the rq repository.
Motivation and context
This PR resolves 2 issues related to rq jobs:
X2
rq job depends onX1
-> runningX1
job is moved to FailedJobRegistry and not deleted -> user creates one moreX1
job that is enqueued afterX2
execution. It was possible due to the second issue when a user tried to export annotations for task 1, then for task 2, and after restarting the worker container user tried again to export annotations for task 1. (cyclic dependence)X
job will never be enqueued whenX
is moved to FailedJobRegistry due to AbandonedJobError. I've submitted the issue to the rq repository.How has this been tested?
Manually
Checklist
develop
branch- [ ] I have updated the documentation accordingly- [ ] I have increased versions of npm packages if it is necessary(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.