Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid rolling up an ERROR state when empty GenericAnalyzer blocks are marked discard_stale, or when all of their items are STALE. #315

Merged
merged 8 commits into from
Jan 25, 2024

Conversation

asymingt
Copy link
Contributor

@asymingt asymingt commented Sep 21, 2023

Add logic to a parent AnalyzerGroup to prevent rolling up an ERROR state when a GenericAnalyzer child block is marked with discard_stale: true and either of these conditions are met:

  1. There are no statuses that match any of the GenericAnalyzer child blocks (its size is zero).
  2. Every matching status in the GenericAnalyzer child block has been marked stale.

In this example, if bar and baz have no matching statuses or all of their statuses are STALE, they will roll up as OK because the discard_stale: true flag implies that stale statuses are disposable.

diagnostics_aggregator:
  ros__parameters:
    pub_rate: 1.0
    path: 'robot'
    analyzers:
      part:
        type: 'diagnostic_aggregator/AnalyzerGroup'
        path: 'part'
        foo:
          type: 'diagnostic_aggregator/GenericAnalyzer'
          path: 'foo'
          find_and_remove_prefix: ['/foo:']
          num_items: 1
        bar:
          type: 'diagnostic_aggregator/GenericAnalyzer'
          path: 'bar'
          find_and_remove_prefix: ['/bar:']
          discard_stale: true
        baz:
          type: 'diagnostic_aggregator/GenericAnalyzer'
          path: 'baz'
          find_and_remove_prefix: ['/baz:']
          discard_stale: true

Signed-off-by: Andrew Symington <andrew.c.symington@gmail.com>
@asymingt asymingt force-pushed the asymingt/aggregate-discard-stale-gracefully branch from 0114a33 to 9378ae6 Compare September 23, 2023 05:00
@asymingt asymingt changed the title If discard_stale = true, don't interpret stale as ERROR when rolling up Avoid rolling up an ERROR state when empty GenericAnalyzer blocks are marked discard_stale Sep 23, 2023
@asymingt asymingt changed the title Avoid rolling up an ERROR state when empty GenericAnalyzer blocks are marked discard_stale Avoid rolling up an ERROR state when empty GenericAnalyzer blocks are marked discard_stale, or when all of their items are STALE. Sep 23, 2023
@ct2034 ct2034 added bug This is a bug in the code (and not a new feature) ros2 PR tackling a ROS2 branch labels Sep 26, 2023
@ct2034
Copy link
Collaborator

ct2034 commented Sep 26, 2023

@asymingt - thanks a lot for your contribution!
Please also add a test case that checks for this and that defines the desired behavior.

@ct2034 ct2034 added the needs more work Someone has worked on this but more work is needed label Sep 26, 2023
@asymingt
Copy link
Contributor Author

@asymingt - thanks a lot for your contribution! Please also add a test case that checks for this and that defines the desired behavior.

I have done my best to add one, given the limited time available to me!

Signed-off-by: Andrew Symington <andrew.c.symington@gmail.com>
@asymingt asymingt force-pushed the asymingt/aggregate-discard-stale-gracefully branch from 5c36a90 to 1ff6893 Compare October 12, 2023 21:43
asymingt and others added 2 commits October 13, 2023 00:26
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
@ct2034 ct2034 removed the needs more work Someone has worked on this but more work is needed label Dec 5, 2023
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
@ct2034
Copy link
Collaborator

ct2034 commented Dec 5, 2023

@asymingt I think I am happy with this now. But could you please have look at the comments and changes I made in 6e852dc and just confirm if they make sende to you?

@ct2034 ct2034 self-assigned this Dec 5, 2023
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
@asymingt
Copy link
Contributor Author

asymingt commented Dec 13, 2023

@asymingt I think I am happy with this now. But could you please have look at the comments and changes I made in 6e852dc and just confirm if they make sende to you?

Yup, those changes make sense. LGTM. Thanks, @ct2034.

@ct2034 ct2034 merged commit 1401f48 into ros:ros2 Jan 25, 2024
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug in the code (and not a new feature) ros2 PR tackling a ROS2 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants