-
Notifications
You must be signed in to change notification settings - Fork 34
Create an optional mechanism to avoid duplicate jobs #80
Comments
Dataproc already has a mechanism for this -- the job id. You cannot have Dataproc jobs with duplicate ids. As long as you don't delete jobs after they finish, this can be used to avoid submitting the same job multiple times.
|
@karth295 Thanks for your answer but there is another case, what if the job had been submitted before and failed for some reason? We want to submit it again to try again. In this case, it will not be able to resubmit. My scenario is:
Other scenario:
|
Ah, fair enough. Another solution to consider is using restartable jobs and letting Dataproc re-run jobs on failure. You can specify a That may or may not work for you, depending on what else your pod needs to do when it's recreated. |
@karth295 Thanks, using both |
We create Kubernetes pods to run Spydra and it submits a job to Dataproc. Sometimes our pods are removed and we automatically recreate the pod(Spydra) again, and it submits that job again. In the end, there are some duplicate jobs are running in Dataproc. Those jobs may take hours which costs a lot.
I think we can create an optional mechanism to avoid this situation by labeling jobs, and when we create a job, we can check whether there is any job with that label whose status is DONE, if so we should not submit that job and can throw an exception.
The text was updated successfully, but these errors were encountered: