Skip to content

Commit d7f3478

Browse files
Google APIscopybara-github
authored andcommitted
docs: clarify tasks success criteria for background runnable
PiperOrigin-RevId: 665192495
1 parent b678386 commit d7f3478

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

google/cloud/batch/v1alpha/task.proto

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,24 @@ message Runnable {
323323
// provided the index of the runnable will be used for outputs.
324324
string display_name = 10 [(google.api.field_behavior) = OPTIONAL];
325325

326-
// Normally, a non-zero exit status causes the Task to fail. This flag allows
327-
// execution of other Runnables to continue instead.
326+
// Normally, a runnable that returns a non-zero exit status fails and causes
327+
// the task to fail. However, you can set this field to `true` to allow the
328+
// task to continue executing its other runnables even if this runnable
329+
// fails.
328330
bool ignore_exit_status = 3;
329331

330-
// This flag allows a Runnable to continue running in the background while the
331-
// Task executes subsequent Runnables. This is useful to provide services to
332-
// other Runnables (or to provide debugging support tools like SSH servers).
332+
// Normally, a runnable that doesn't exit causes its task to fail. However,
333+
// you can set this field to `true` to configure a background runnable.
334+
// Background runnables are allowed continue running in the background while
335+
// the task executes subsequent runnables. For example, background runnables
336+
// are useful for providing services to other runnables or providing
337+
// debugging-support tools like SSH servers.
338+
//
339+
// Specifically, background runnables are killed automatically (if they have
340+
// not already exited) a short time after all foreground runnables have
341+
// completed. Even though this is likely to result in a non-zero exit status
342+
// for the background runnable, these automatic kills are not treated as task
343+
// failures.
333344
bool background = 4;
334345

335346
// By default, after a Runnable fails, no further Runnable are executed. This
@@ -358,15 +369,13 @@ message TaskSpec {
358369
// Required. The sequence of one or more runnables (executable scripts,
359370
// executable containers, and/or barriers) for each task in this task group to
360371
// run. Each task runs this list of runnables in order. For a task to succeed,
361-
// all of its script and container runnables each must either exit with a zero
362-
// status or enable the `ignore_exit_status` subfield and exit with any
363-
// status.
372+
// all of its script and container runnables each must meet at least one of
373+
// the following conditions:
364374
//
365-
// Background runnables are killed automatically (if they have not already
366-
// exited) a short time after all foreground runnables have completed. Even
367-
// though this is likely to result in a non-zero exit status for the
368-
// background runnable, these automatic kills are not treated as Task
369-
// failures.
375+
// + The runnable exited with a zero status.
376+
// + The runnable didn't finish, but you enabled its `background` subfield.
377+
// + The runnable exited with a non-zero status, but you enabled its
378+
// `ignore_exit_status` subfield.
370379
repeated Runnable runnables = 8;
371380

372381
// ComputeResource requirements.

0 commit comments

Comments
 (0)