Skip to content

refactor(gateway): lock expiry, scripts and peer aggregation are wired by the core - #762

Open
bburda wants to merge 6 commits into
feat/gateway-core-10-core-freeze-framesfrom
feat/gateway-core-11-core-host-wiring
Open

bburda wants to merge 6 commits into
feat/gateway-core-10-core-freeze-framesfrom
feat/gateway-core-11-core-host-wiring

Conversation

@bburda

@bburda bburda commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Wiring that every program hosting the core needs moves out of the node:

  • LockReaper removes expired locks and their cyclic subscriptions on a thread the core owns. locking.cleanup_interval below 1 is raised to 1 second.
  • make_script_host(ScriptsConfig, backend) builds the script manager with the default provider.
  • AggregationHost owns the aggregation manager, mDNS discovery and the peer merge.
  • A host without a lifecycle reader gets presence-based status and 501 for transitions; this is now documented.

The node uses the same pieces and keeps its parameters.


Issue


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • scripts/check_cores_without_ros/run.sh: an expired lock and its subscription go away without host code, a script runs over HTTP, a second core server is read as a peer, and the lifecycle routes answer with no reader.
  • ./scripts/test.sh integ --packages-select ros2_medkit_integration_tests covers the node path (locking, scripts, aggregation, lifecycle tests).

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

LockReaper calls LockManager::cleanup_expired() on a thread it owns and removes the cyclic subscriptions in an expired lock's scope, so a host without a ROS timer no longer keeps expired locks. The ROS 2 node starts the same class in place of its wall timer, and the ROS-free check requires the lock and its subscription to be gone after the expiry.
make_script_host() returns a ScriptManager backed by the plugin provider, or by a DefaultScriptProvider built from ScriptsConfig when a scripts directory is set. The ROS 2 node reads its parameters and manifest scripts into the same config and calls it, and the ROS-free check uploads a script over HTTP, runs it and reads its output.
AggregationHost builds the AggregationManager and the mDNS discovery from an AggregationConfig, and merge_peers() merges the peers' entities and publishes the routing table, leaf warnings and contributors. The ROS 2 node keeps its parameter parsing and uses the class, and the ROS-free check starts a second server in the same process as a peer and reads its entity through the first.
A host passes a null LifecycleStateReader: the status route then reports readiness from graph presence and a transition answers 501 without a LifecycleProvider. The ROS-free check pins both answers, also for an app that exposes the lifecycle services.
@bburda bburda self-assigned this Oct 26, 2026
@bburda
bburda added this pull request to stack #759 October 26, 2026 19:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant