Module state

The configuration dispatcher provides the current state of modules as Values. Those Values are automatically provided for every module and can be subscribed on. To do so, use the module id (i.e. modules.modbus.modbus-1 for example).

Those Values are of type TEXT and can have following content :

  • RUNNING : The module is running, this is the normal state for a module.

  • CONFIG_OUTDATED : A configuration mismatch was detected between the module and the osp-configuration-dispatcher. When a module is in this state, the osp-configuration-dispatcher will ask the module to restart and fetch its latest configuration. This typically happens after changing the module configuration.

  • UNREACHABLE : The module did not send its heartbeat in time, so it is considered to be down. This will typically happen when a module restarts (after a CONFIG_OUTDATED for example), and in case of network or module failure. A module not sending heartbeats anymore will be detected as UNREACHABLE after at least 5 seconds and at most 10 seconds.

    Note

    If a module is down less than 5 seconds, it may not be reported as UNREACHABLE.

  • REMOVED : The module no longer exist. This typically happens when the module was removed (by a configurationchange) but subscriptions to its Value were done when it still existed.

Note

On configuration dispatcher startups, all modules are first seen as UNREACHABLE until they send their first heartbeat. This can happen when adding a new module, since the configuration dispatcher needs to be restarted in this case.

Monitored and unmonitored modules

The configuration dispatcher provides a state Values for each module in the configuration, however, not all of them have the ability to send heartbeats to inform the configuration dispatcher of their state. Those modules are thus always seen in the state UNREACHABLE.

The detailed list is available on modules capabilities.