-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(job-runner): track job status #6332
base: master
Are you sure you want to change the base?
Conversation
status
subcommand for snuba jobs
status
subcommand for snuba jobs
b05d98e
to
c0270df
Compare
JOB_ID = "abc1234" | ||
test_job_spec = JobSpec(job_id=JOB_ID, job_type="ToyJob") | ||
|
||
# @pytest.fixture(autouse=True) |
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.
it turns out the state of the redis client does not persist outside, so after inserting ['abc1234', 'not started'] during init of ToyJob, redis_client.hkeys would show nothing inserted in test_job_status_changes_to_finished
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
self._set_status(RUNNING) | ||
self._execute() | ||
self._set_status(FINISHED) |
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.
I'm thinking that we might want status tracking to live outside Job
.I think of Job as more of an interface for users to implement, rather than something that contains logic for running jobs itself (I also think things can get confusing quickly when you rely on inheritance in Python).
What if we had something like a JobRunner static class or module that exposed utilities that would orchestrate the job run, and manage status based on the completely separate Job class? I think that produces a looser coupling.
https://getsentry.atlassian.net/browse/SNS-2869