Streams statuses

During the processing, the stream can go through the following statuses:

  • pending - stream is waiting for processing

    stream has pending status after creation, recreation and while autorestart is in progress

  • in_progress - stream processing is in progress

    stream has in_progress status only while stream processing is in progress

  • done - stream processing is completed

    stream has done status when stream processing ends (stream ends or videofile completely proceed)

  • restart - stream processing is restarted by server

    stream has restart status if autorestart is enabled and restart is in progress (see autorestart chapter for details)

  • failure - stream processing is failed

    stream has failure if agent sends feedback with such status

  • stop - stream processing is stopped by user

    stream has stop status if stream processing was stopped by user

Stream lifecycle

The stream general lifecycle is presented here:

  • stream creation by making stream creation request

    stream status is pending

  • the Luna-Video-Agent finding an agent which can execute required analytics

  • stream processing starts

    stream status is in_progress

  • optional: stop/resume stream processing:

    • stop stream processing by making stream patch request

      stream status is stop

    • resume stream processing by making stream patch request

      stream status is pending

      the Luna-Video-Agent finding an agent which can execute required analytics and

      stream status is in_progress

  • processing ends

    • stream ends: agent stops processing and sends feedback to Luna-Video-Manager with done status

      stream status is done

    • stream removed by making stream deletion request

      stream no more exist

    • processing ends because fatal error occurred (agent sent corresponding feedback)

      stream status is failure

While stream status is in_progress, agent will periodically send feedback to Luna-Video-Manager and execute callbacks.

Streams autorestart

The possibility of autorestart is actual for streams with failure status. Parameters (possibility, maximum number of restart attempts, delay between attempts) are specified by the user for each stream in autorestart section (see create stream request description). The parameters and autorestart status can be received using get stream request.

Note

stream won’t be autorestarted after a fatal error. This includes file not found error, invalid rectangle, validation error.

Stream autorestart statuses

  • disabled - stream autorestart is disabled by user (restart parameter in autorestart section in stream creation request)

  • enabled - stream autorestart is enabled, but not active at the moment (stream is not in failure status)

  • in_progress - autorestart in progress

  • failed - the allowed number of auto-restart attempts have been made, but did not lead to success

Note

stream autorestart status list may be expanded in the future

The possibility of autorestart is actual for streams with failure status.

Stream autorestart process

Here and below are described only streams with enabled autorestart. Described actions will be executed as periodical background task of master instance, period of execution can be configured using LUNA_VIDEO_MANAGER_STREAMS_AUTORESTARTER_INTERVAL setting. It is highly not recommended to change this value without understanding of consequences.

Each stream restart attempt will automatically change:

  • stream status to restart and then to pending

  • stream autorestart current_attempt will be increased by 1

  • last_attempt_time will be actualized

The following conditions will trigger a stream restart:

  • stream status is failure

  • stream autorestart status is enabled

  • stream autorestart current_attempt is null or current_attempt is less than attempt_count

  • stream autorestart last_attempt_time is null or difference between the current time and last_attempt_time is greater than or equal to stream autorestart delay

The following conditions will trigger a stream autorestart failure:

(this cause no more automatically attempts to restart stream)

  • stream status is failure

  • stream autorestart status is in_progress

  • stream autorestart current_attempt is equals to attempt_count

The following conditions will trigger a stream autorestart complete:

(this cause stream autorestart status change to enabled and reset stream autorestart current_attempt and last_attempt_time)

  • stream status is not equals failure status

  • stream autorestart status is in_progress

  • stream autorestart last_attempt_time is null or difference between the current time and last_attempt_time is greater than or equal to stream autorestart delay