diagnostics aggregator: discard_stale with no effect

asked 2018-09-19 15:58:17 -0500

knxa gravatar image

I am testing how I can setup GenericAnalyzer for a node that is not always present. I was expecting discard_stale: True to do the trick, so the stale state is not posted when the data is missing.

My test node diagnostic_error_faker produces diagnostics data like:

rostopic echo /diagnostics
[snip]
    level: 1
    name: "diagnostic_error_faker: Device A"
    message: "Non-optimal value: 22"
    hardware_id: "Faked Device"
    values: 
      - 
        key: "tick value"
        value: "22"

yaml loaded to aggregator_node:

[snip]
  fake:
    type: diagnostic_aggregator/GenericAnalyzer
    path: fake_errors
    startswith: 'diagnostic_error_faker'
    find_and_remove_prefix: 'diagnostic_error_faker: '
    discard_stale: true

Aggregator topic is ok:

rostopic echo /diagnostics_agg
[snip]
    level: 1
    name: "/fake_errors/Device A"
    message: "some value: 12"
    hardware_id: "Faked Device"
    values: 
      - 
        key: "tick value"
        value: "12"

But if I then kill the node that produces the diagnostic_error_faker data, I would expect the diagnostics_agg to no longer show the fake_errors due to the setting discard_stale: True.

But:

rostopic echo /diagnostics_agg
[snip]

    level: 3
    name: "/fake_errors"
    message: "Stale"
    hardware_id: ''
    values: []

What am I doing wrong?

edit retag flag offensive close merge delete

Comments

This might be an example of this bug

knxa gravatar image knxa  ( 2019-04-02 06:14:57 -0500 )edit