Repository navigation
Conversation
bburda
force-pushed
the
feat/rosbag-retention-1a
branch
from
December 1, 2026 15:43
05287b6 to
608d8de
Compare
mfaferek93
reviewed
Dec 2, 2026
|
|
||
| // Created cancelled: it runs only while an own-fault action is pending. | ||
| retention_timer_ = create_wall_timer(std::chrono::seconds(1), [this]() { | ||
| if (!retention_pass()) { |
Collaborator
There was a problem hiding this comment.
retention_pass() reaches core_->get(), and the core only catches IgnorableConnectionException from storage. Any other storage error, for example a PostgreSQL statement timeout while a maintenance job holds a table lock, or SQLite busy/IOERR, throws out of this timer callback, out of spin(), and the node exits instead of retrying. Could the timer body catch std::exception, log it and keep the timer armed? #862 routes the storage-availability fault through this timer too.
bburda
force-pushed
the
feat/rosbag-retention-1a
branch
from
December 2, 2026 12:15
608d8de to
11e80bd
Compare
* feat(fault_manager): parse and validate rosbag retention rules * fix(fault_manager): satisfy clang-tidy in the retention policy and node * feat(fault_manager): stop on parameters-file keys the loader moves, drive the own fault from events * feat(fault_manager): compare the loader's reading of parameters files with ours, re-report on every confirmation * docs(fault_manager): describe the moved-key comparison and the start-up failures * test(fault_manager): start from a correct section in the second document * fix(fault_manager): create the retention timer before the started message * fix(fault_manager): satisfy clang-tidy in the parameters file reading * feat(fault_manager): apply sections as rclcpp does, compare per section as multisets, verify confirmation candidates * fix(fault_manager): compare parameters files as rcl merges them, signal confirmations exactly * fix(fault_manager): treat a stop signal during startup as a clean stop * fix(fault_manager): keep construction and spinning as separate phases in main
bburda
force-pushed
the
feat/rosbag-retention-1a
branch
from
December 2, 2026 18:24
11e80bd to
2343f85
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Issue 705 adds configurable rosbag retention. This PR adds the rule configuration and its validation; it does not change which recordings are removed yet. The next PR of the stack makes the store use the rules.
This PR is on top of two PRs in the stack. Please review those first. The diff of this PR is against the branch of the PR directly below it.
What it adds:
core::RetentionPolicy, ROS-neutral: it parses thesnapshots.rosbag.retention.*parameters and resolves the rule of a fault field by field from four levels: the fault code, the first matching pattern inpattern_order, the fault's severity, the defaults. Two fields exist so far:priority(0-1000, default 0) andover_quota(keepdefault, ordrop).ROSBAG_RETENTION_CONFIG_INVALID(CRITICAL, source the fault manager node, description the errors). That fault starts no capture. If it is cleared while the configuration is still wrong, the next confirmed fault reports it again (also a muted confirmation, one inside the capture cooldown, and one confirmed by the tick). A start with a valid configuration, or none, clears it. If the storage is unreachable at start, the report or the clear is retried until the storage accepts it.CaptureHooksgainson_confirmedandon_confirm_candidate, so the node learns about every confirmation without calling into the core under its mutex.config/rosbag_retention.example.yaml, and the docs (docs/config/fault-manager.rst, the fault manager README and design doc).Two decisions that differ from the issue text:
.is configured through a pattern whosematchescapes the dot (GNSS\.FIX_LOST), not as afault_codeskey, because the ROS YAML loader cannot read a dotted key there reliably (next section).What changes for users
RCLErrorfrom creating the executor). An exception while the fault manager runs is now logged as "Fault manager stopped on an error" with exit code 1.defaultsbecomesfault_codes.defaults, orsnapshots.rosbag.enabledlands underretention, so rosbag capture is off although the file saysenabled: true. At startup the fault manager now reads each parameters file a second time with its own YAML reader. It compares, in every section that rclcpp applies to the node, the names the loader produced with the names the file says. Any difference stops it with a message that names the file, the moved parameters, and the key and line that caused it. This covers the whole fault manager section of the file, not only the retention keys. A file the loader reads correctly is not affected. Flattened top-level keys (snapshots.rosbag.enabled: truedirectly underros__parameters) keep working.-poverride under the retention prefix with more key segments than the grammar allows also stops the fault manager with exit code 1.snapshots.rosbag.enabledis false give one WARN and are not validated.Issue
Type
Testing
colcon build --packages-up-to ros2_medkit_fault_manager --cmake-args -DPOSTGRES_SUPPORT=ON, thencolcon test --packages-select ros2_medkit_fault_managerandcolcon test-result --verbose.test_retention_config.test.pyandtest_retention_config_pg.test.py(PostgreSQL behind a TCP proxy that refuses connections until the test opens it) insrc/ros2_medkit_fault_manager/test/integration. Run them withctest -R test_retention. The rule resolution is inRetentionRuleResolution.EachFieldFromFirstLevelThatSetsIt.--params-file config/rosbag_retention.example.yamland rosbag capture on. The log shows the policy line. Change apriorityto1001: the fault list showsROSBAG_RETENTION_CONFIG_INVALID, and recording goes on as before.Checklist