Jump to content

Heartbeat: Difference between revisions

From Event Gates Wiki
No edit summary
Line 25: Line 25:
** If <code>true</code>: The system tolerates partial Vislet failures and continues operation unless a broader failure occurs.
** If <code>true</code>: The system tolerates partial Vislet failures and continues operation unless a broader failure occurs.
HB is part of VIS configuration.
HB is part of VIS configuration.
== How-to ==
=== How to set heartbeat ===


== FAQ ==
== FAQ ==

Revision as of 19:58, 11 July 2025

Heartbeat

The heartbeat (HB) feature in VIS ensures that both the system and critical integration components—such as IO cards—remain responsive. While VIS is self-aware and can detect internal states of functionality, it may not be able to notify external systems (the "listening party") if the integration layer fails or if there is a major system-wide malfunction. To address this, the heartbeat periodically sends a signal (bit) to the listening party. If the heartbeat signal fails to arrive, the listening party can infer a failure and take appropriate action—such as halting operation or triggering a fail-safe response.

Purpose

The heartbeat serves two distinct but related purposes:

  1. External signaling: A bit-level toggle is periodically transmitted to the IO module to signal ongoing healthy operation.
  2. Internal liveness check: VIS monitors individual Vislets (processing pipelines) to determine if they are still functioning. If no output is received from a Vislet during a heartbeat interval, that Vislet is considered non-functional or "dead."

Behavior

  • After each frame is processed by a Vislet, the output is sent to a shared pool. As long as messages are received from a Vislet during the heartbeat interval, it is assumed to be alive.
  • If a Vislet stops its grab → detect → interpret → emit loop, it stops sending messages. The heartbeat component detects this and marks the Vislet as unavailable.
  • When at least one Vislet is marked dead (depending on configuration), the heartbeat signal to the IO module may stop, indicating a system-level failure.

Auto-Resurrection

If a Vislet becomes responsive again, the heartbeat automatically resumes. This behavior is not configurable—any recovered Vislet re-enables its contribution to the heartbeat mechanism without requiring manual intervention.

Configuration

The heartbeat supports two configuration parameters:

  • period (int): The interval in seconds between each call to the toggle method. Default is 5 seconds.
  • partial_death (bool): Determines how strictly the system interprets Vislet failures.
    • If false (default): The system declares death if any Vislet is lost.
    • If true: The system tolerates partial Vislet failures and continues operation unless a broader failure occurs.

HB is part of VIS configuration.

How-to

How to set heartbeat

FAQ

Q: Can the Heartbeat keep an output (e.g., relay) open or closed when it stops?

A: No. When the Heartbeat stops—due to a Vislet failure or a system error—it simply stops toggling the output. VIS does not actively force or maintain the output in either an open or closed state. The output remains in whatever state it was last toggled to. Whether the relay stays open or closed depends on the timing of the last toggle and how the external system interprets a static (non-toggling) signal.

Q: If VIS fails to record logs, save video logs or send emails, will the Heartbeat stop?

A: No. The Heartbeat continues as long as the Vislet pipeline is active and emitting outputs. Log recording is not directly tied to the Heartbeat. A failure in logging alone (e.g., disk full) does not stop the heartbeat unless it disrupts the Vislet's ability to process and emit frames.