Job Fostering

Job fostering is the processes of artificially consuming a job slot on a tasker in order to represent an externally running job or process.

The vovfosterjob utility runs as a job on a tasker and monitors an external job or process. When the external job or process exits, the vovfosterjob utility will also exit, freeing up the slot in which it was running.

vovfosterjob


vovfosterjob: Usage Message

  DESCRIPTION:
    A system utility to tell a tasker to watch a PID or a JOB by creating
    a foster job that runs for the lifetime of the entity being watched.
    Resulting foster jobs are stored in the System:Orphanage set, which
    can be displayed by passing the set name to 'nc list -alljobs -set'.

    This utility is mainly used to prevent overloading of a tasker that
    has been started on a host that also has a tasker in the process of
    shutting down gracefully. Such taskers will only exit once any jobs
    running on them are complete. Fostering such jobs onto the newly started
    tasker will result in job slots being consumed, preventing additional
    jobs from landing on the host.

  OPTIONS:
    -h                   -- Display usage help.
    -v                   -- Increase output verbosity. Repeatable.
    -pid       PID       -- Foster a process. Without the -host or -totasker
                            option, the resulting foster job will be dispatched
                            to the first tasker found that is running on the same
                            host where the vovfosterjob command is executed. If
                            the PID does not exist, the foster job will be
                            created but will exit immediately.
                            Compatible with the -host and -totasker options.
    -host      HOSTNAME  -- Specify host to which the foster job should be
                            dispatched. The resulting foster job will be
                            dispatched to the first tasker found on the
                            specified host.
                            Compatible with the -pid and -job options.
    -job       JOBID     -- Foster a job. Without the -host or -totasker option,
                            the resulting foster job will be dispatched to the
                            first tasker found that is running on the same host
                            as the job being fostered.
                            Compatible with the -host and -totasker options.
    -fromtasker TASKERNAME --
                            Foster all jobs on specified tasker. Normally used
                            to foster jobs on a tasker that has been requested
                            to gracefully stop after its jobs are finished. This
                            helps to prevent overloading if the tasker is
                            restarted before the job attrition process is
                            complete.
                            Compatible only with, and requires, the -totasker
                            option.
    -totasker TASKERNAME -- Specify tasker to which the foster job should be
                            dispatched. Compatible with the -pid, -job, and
                            -fromtasker options.
    -stoppedtaskers TASKERNAME --
                            Foster jobs running on all prior instances of the
                            specified tasker that are in the process of stopping
                            gracefully. The resulting foster jobs will be
                            dispatched to the specified tasker. Not compatible
                            with any other option.

  OPTIONS: (Deprecated)
    -fromslave SLAVENAME -- Foster all jobs on specified slave. Normally used
                            to foster jobs on a slave that has been requested
                            to gracefully stop after its jobs are finished. This
                            helps to prevent overloading if the slave is
                            restarted before the job attrition process is
                            complete.
                            Compatible only with, and requires, the -toslave
                            option.
    -toslave   SLAVENAME -- Specify slave to which the foster job should be
                            dispatched. Compatible with the -pid, -job, and
                            -fromslave options.
    -stoppedslaves SLAVENAME --
                            Foster jobs running on all prior instances of the
                            specified slave that are in the process of stopping
                            gracefully. The resulting foster jobs will be
                            dispatched to the specified slave. Not compatible
                            with any other option.

  EXAMPLES:
    % vovfosterjob -job 000123456
    % vovfosterjob -job 000123456 -totasker titan
    % vovfosterjob -pid 6789
    % vovfosterjob -pid 6789 -host titan
    % vovfosterjob -fromtasker titan_stopped -totasker titan
    % vovfosterjob -stoppedtaskers titan