-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Job with multiple executions #1964
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1964 +/- ##
==========================================
+ Coverage 93.61% 93.84% +0.22%
==========================================
Files 28 29 +1
Lines 3757 3897 +140
==========================================
+ Hits 3517 3657 +140
Misses 240 240
☔ View full report in Codecov by Sentry. |
@@ -55,6 +56,13 @@ class JobStatus(str, Enum): | |||
CANCELED = 'canceled' | |||
|
|||
|
|||
def parse_job_id(job_or_execution_id: str) -> str: | |||
"""Parse a string and returns job ID. This function supports both job ID and execution composite key.""" | |||
if ':' in job_or_execution_id: |
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 a problem: when creating a standard job, you can pass a job_id to it, so that instead of using the default uuid, you can use your own custom job id convention.
We use that, and we already use :
and |
as special separator in the job id. This code change breaks the tacit contract and now a job id can't contain some characters. This could break stuff in production for some users (it will for us...)
Can't the execution id be stored somewhere else ?
Since rq/rq#1964 the job status is set to Failed before the handler decides whether to capture or not the exception while handle_job_failure has not yet been called so the job is not yet re-scheduled leading to all exceptions getting captured in RQ version >= 2.0. Related to #1076 Fixes #3707
This PR introduces an
Execution
object to represent a job's execution. Completion of this PR should allow us to properly track multiple job executions.