Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 'Logging and Handling of Errors' added

...

Jobs which use the JobScheduler API Interface may implement more sophisticated methods to choose whether an error is blamed on the job or on the order and how to handle errors that occur in orders.

Logging and Handling of Errors

Behavior up to and including Version 1.9

When a shell script is executed within a job and when this script writes messages to the standard output and error channels (stdout and stderr) then the JobScheduler treats these as info messages.

  • Logging:
    • the JobScheduler writes these messages to the task's log with severity "info", e.g.
      2015-03-18 07:57:38.991+0100 [info] This message goes to stdout
      2015-03-18 07:57:38.993+0100 [info] This message goes to stderr
    • The user cannot decide from the log if output from the shell script has been written to stdout or to stderr.

 

  • Error Handling:
    • the JobScheduler handles the script execution as being successful if the exit code returned by the script is 0.

 

Behavior with Version 1.10 and newer

Display feature availability
StartingFromRelease1.10

Job error handling can optionally be extended to include errors arising from shell scripts.

Jira
serverSOS JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJS-1393

Jira
serverSOS JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId6dc67751-9d67-34cd-985b-194a8cdc9602
keyJS-1329

Behavior

  • Logging:
    • Messages received via the standard error channel are added with error severity, e.g.
      2015-03-18 07:57:38.993+0100 [error]  This message goes to stderr
    • This behavior has precedence over JS-1393, i.e. no specifics to identify the error channel as with [stderr] are added.
  • Error Handling:
    • The JobScheduler raises an error for any output to stderr from the shell script.
    • Depending on the job settings and the job node settings the usual behavior for failed execution would apply, e.g. the job could be stopped, the order could be suspended, setback, etc.

Note that:

  • This option applies to shell jobs, not to API jobs.
  • It applies to jobs executed by JobScheduler instances, including clustered instances, and to JobScheduler Agents. An Agent forwards errors to the relevant JobScheduler Master.

Configuration

  • Error handling for shell jobs is configured with the <job stderr_log_level="error|info"> job attribute.
    • A value error causes shell job errors to be considered by JobScheduler as errors.
    • The default value is info and causes the JobScheduler to stick to the behavior described for version 1.9 above.

Change Management References

Jira
serverSOS JIRA
columnstype,key,issuelinks,fixversions,status,priority,summary,updated
maximumIssues20
jqlQuerylabels in (error-handling) and labels in (shell-script)
serverId6dc67751-9d67-34cd-985b-194a8cdc9602