Don't crash if mapper times out

We've seen cases where there is so much going on at once on a system
that the mapper will get too busy and calls to it will time out.

When this happens to virtual-sensors it will core dump and restart, but
eventually over time it can accumulate so many restarts that it will hit
systemd's restart limit and no longer be restarted.

To avoid this, just do the same thing as when the sensor isn't on D-Bus,
which is to ignore that sensor for now and try again the next time the
virtual sensor is calculated.

Change-Id: I6a09fe4c56070f1b23c97f66fe38f3b900e02ee9
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
1 file changed
tree: 131ab39faaadff8d4565df549f44772af635f66d
  1. subprojects/
  2. .clang-format
  3. .editorconfig
  4. .gitignore
  5. .prettierrc.yaml
  6. dbusSensor.hpp
  7. dbusUtils.hpp
  8. exprtkTools.hpp
  9. LICENSE
  10. meson.build
  11. OWNERS
  12. phosphor-virtual-sensor.service.in
  13. README.md
  14. thresholds.hpp
  15. virtual_sensor_config.json
  16. virtualSensor.cpp
  17. virtualSensor.hpp
README.md

phosphor-virtual-sensor

phosphor-virtual-sensor reads in virtual_sensor_config.json There are two types of data in this file:

virtual sensor configuration information

See virtual_sensor_config.json in this repository for an example. Sensors added this way can use any expression that is accepted by exprtk.

information to get a virtual sensor configuraton from D-Bus

For example:

{
  "Desc": {
    "Config": "D-Bus",
    "Type": "ModifiedMedian"
  }
}

Sensors added this way can only use a set of restricted calculations. At this stage the only type supported is modifiedMedian.

The virtual sensor configuration information needs to be added into the relevant hardware configuration file in entity-manager. This method of adding a virtual sensor allows a recipe that builds for different hardware configurations to have different virtual sensors for each configuration.

The virtual sensor configuration in entity manager follows a different format to the JSON in virtual_sensor_config.json (specified in entity-manager/schemas/VirtualSensor.json).