public sealed class LifecyclePolicy : IMessage<LifecyclePolicy>, IEquatable<LifecyclePolicy>, IDeepCloneable<LifecyclePolicy>, IBufferMessage, IMessage
Reference documentation and code samples for the Batch v1 API class LifecyclePolicy.
LifecyclePolicy describes how to deal with task failures
based on different conditions.
public LifecyclePolicy.Types.Action Action { get; set; }
Action to execute when ActionCondition is true.
When RETRY_TASK is specified, we will retry failed tasks
if we notice any exit code match and fail tasks if no match is found.
Likewise, when FAIL_TASK is specified, we will fail tasks
if we notice any exit code match and retry tasks if no match is found.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eLifecyclePolicy\u003c/code\u003e class within the Google Cloud Batch v1 API, detailing its purpose in managing task failures.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLifecyclePolicy\u003c/code\u003e class, found in the \u003ccode\u003eGoogle.Cloud.Batch.V1\u003c/code\u003e namespace, describes how to handle task failures based on specific conditions, offering both \u003ccode\u003eRETRY_TASK\u003c/code\u003e and \u003ccode\u003eFAIL_TASK\u003c/code\u003e actions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLifecyclePolicy\u003c/code\u003e class is accessible through various versions of the API, from 1.0.0 up to the latest 2.13.0, and in this document, focuses on version 2.6.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLifecyclePolicy\u003c/code\u003e class has two properties: \u003ccode\u003eAction\u003c/code\u003e, which determines the action to take (retry or fail), and \u003ccode\u003eActionCondition\u003c/code\u003e, which defines the conditions triggering the action.\u003c/p\u003e\n"],["\u003cp\u003eThis page provides both a public default constructor \u003ccode\u003eLifecyclePolicy()\u003c/code\u003e, and one taking a \u003ccode\u003eLifecyclePolicy\u003c/code\u003e parameter \u003ccode\u003eLifecyclePolicy(LifecyclePolicy other)\u003c/code\u003e, to copy or create a new instance of the same settings.\u003c/p\u003e\n"]]],[],null,[]]