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
Replace custom task cancellation with RQ 1.7 functionality #1040
Conversation
RQ feature: rq/rq#1376 |
Attached issue: https://pulp.plan.io/issues/7902 |
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.
This is awesome. Good find @dralley.
|
||
resource_job.delete() | ||
job.delete() | ||
|
||
# A hack to ensure that we aren't deleting resources still being used by the workhorse | ||
time.sleep(1.5) |
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.
Maybe we should keep this but reduce it to ~0.1 seconds?
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.
Yeah I'm not entirely sure what to do. I'm trying to think through it; so the resources delete while the task is in use, and it receives a database write error in the task at some point?
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.
Maybe that's ok?
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.
There's an inherent delay in between when the cancellation is triggered and when it actually happens. Before that delay was due to polling, now it's message passing so it should be faster but technically still present.
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.
The main thing is that we should avoid cancellations being marked as failures.
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.
@bmbouter I'm thinking I should just err towards caution and add it back for now.
if resource_job.is_started: | ||
redis_conn.sadd(TASKING_CONSTANTS.KILL_KEY, resource_job.get_id()) | ||
# A hack to ensure that we aren't deleting resources still being used by the workhorse | ||
time.sleep(0.5) |
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.
👍
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.
Thank you for switching us back to the upstream feature.
closes: #7902
https://pulp.plan.io/issues/7902