Skip to content

Commit 07ede94

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

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

google/cloud/batch/v1/task.proto

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

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

311-
// This flag allows a Runnable to continue running in the background while the
312-
// Task executes subsequent Runnables. This is useful to provide services to
313-
// other Runnables (or to provide debugging support tools like SSH servers).
313+
// Normally, a runnable that doesn't exit causes its task to fail. However,
314+
// you can set this field to `true` to configure a background runnable.
315+
// Background runnables are allowed continue running in the background while
316+
// the task executes subsequent runnables. For example, background runnables
317+
// are useful for providing services to other runnables or providing
318+
// debugging-support tools like SSH servers.
319+
//
320+
// Specifically, background runnables are killed automatically (if they have
321+
// not already exited) a short time after all foreground runnables have
322+
// completed. Even though this is likely to result in a non-zero exit status
323+
// for the background runnable, these automatic kills are not treated as task
324+
// failures.
314325
bool background = 4;
315326

316327
// By default, after a Runnable fails, no further Runnable are executed. This
@@ -339,15 +350,13 @@ message TaskSpec {
339350
// Required. The sequence of one or more runnables (executable scripts,
340351
// executable containers, and/or barriers) for each task in this task group to
341352
// run. Each task runs this list of runnables in order. For a task to succeed,
342-
// all of its script and container runnables each must either exit with a zero
343-
// status or enable the `ignore_exit_status` subfield and exit with any
344-
// status.
353+
// all of its script and container runnables each must meet at least one of
354+
// the following conditions:
345355
//
346-
// Background runnables are killed automatically (if they have not already
347-
// exited) a short time after all foreground runnables have completed. Even
348-
// though this is likely to result in a non-zero exit status for the
349-
// background runnable, these automatic kills are not treated as Task
350-
// failures.
356+
// + The runnable exited with a zero status.
357+
// + The runnable didn't finish, but you enabled its `background` subfield.
358+
// + The runnable exited with a non-zero status, but you enabled its
359+
// `ignore_exit_status` subfield.
351360
repeated Runnable runnables = 8;
352361

353362
// ComputeResource requirements.

0 commit comments

Comments
 (0)