-
Notifications
You must be signed in to change notification settings - Fork 60
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
What are the guarantees regarding single (non-duplicate) job execution? #31
Comments
https://github.com/GoogleCloudPlatform/appengine-pipelines/wiki/Python#what-is-a-pipeline
|
Oh that was my bad, I made sure I had read the Java wiki because that's the version I am using, but never considered the python one. 👍 |
Right, pipeline code is expected be idempotent in both cases. I am not Arie. On Thu, Apr 23, 2015 at 5:40 AM, Irineu notifications@github.com wrote:
|
Hi @aozarov , Thank you very much for further expanding on this. I assume this is the code snippet where CAS happens. jobRecord.setState(State.WAITING_TO_FINALIZE);
jobRecord.setChildGraphGuid(currentRunGUID);
updateSpec.getFinalTransaction().includeJob(jobRecord);
updateSpec.getFinalTransaction().includeBarrier(finalizeBarrier);
backEnd.saveWithJobStateCheck(
updateSpec, jobRecord.getQueueSettings(), jobKey, State.WAITING_TO_RUN, State.RETRY); Now what is intriguing me is the fact that there is also a CAS-like operation before running the job but without actually changing the job state: if (!backEnd.saveWithJobStateCheck(
tempSpec, jobRecord.getQueueSettings(), jobKey, State.WAITING_TO_RUN, State.RETRY)) {
logger.info("Ignoring runJob request for job " + jobRecord + " which is not in a"
+ " WAITING_TO_RUN or a RETRY state");
return;
} Could we not seize this and use another State (e.g., RUNNING) to assure the run-only-once effect? I might be being too naive here since if it were this simple it'd have been done this way already, but it does not cost to ask. |
lets say you changed it to RUNNING and then failed without a chance to change back the state... |
Indeed, either way thanks again! I'm closing this as it has been answered already. |
I am aware that the current implementation of the Pipleines API is based on App Engine Task Queues and, as such, this made me wonder whether the same warning about possible duplicate task execution applies to job executions. Is there any guarantees that a job will be executed only once (not considering job retries)? Or should a job always be idempotent?
The text was updated successfully, but these errors were encountered: