-
Notifications
You must be signed in to change notification settings - Fork 2
fix(gateway): #153 serialize parameter operations to prevent executor… #154
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Serializes ConfigurationManager parameter operations to avoid SyncParametersClient executor conflicts under concurrent HTTP requests (fix for #153).
Changes:
- Added a mutex to serialize parameter operations (
list/get/set/reset/reset_all) inConfigurationManager. - Added a regression test that stresses concurrent parameter operations and asserts no executor-conflict exceptions occur.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ros2_medkit_gateway/src/configuration_manager.cpp | Wraps parameter operations with a mutex to prevent concurrent SyncParametersClient spins. |
| src/ros2_medkit_gateway/include/ros2_medkit_gateway/configuration_manager.hpp | Declares the new mutex and documents the rationale. |
| src/ros2_medkit_gateway/test/test_configuration_manager.cpp | Adds a concurrent regression test intended to catch executor-conflict errors. |
src/ros2_medkit_gateway/include/ros2_medkit_gateway/configuration_manager.hpp
Outdated
Show resolved
Hide resolved
… conflicts SyncParametersClient internally spins param_node_ via spin_node_until_future_complete(), which is not thread-safe. Concurrent HTTP requests would cause: "Node '/_param_client_node' has already been added to an executor" Add mutex to serialize all parameter operations (list, get, set, reset). Add regression test with warm-up to prevent flaky CI failures.
709de51 to
858bac9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
ROS2 parameters like qos_overrides./parameter_events.publisher.depth contain slashes in their names. cpp-httplib decodes percent-encoded URLs (%2F -> /), so the route regex must use (.+) instead of ([^/]+) to match the full parameter name. This is consistent with the existing pattern for topic routes.
d27a343 to
341174e
Compare
Pull Request
Summary
serialize parameter operations to prevent executor conflicts
SyncParametersClient internally spins param_node_ via spin_node_until_future_complete(),
which is not thread-safe. Concurrent HTTP requests would cause:
Node /_param_client_node has already been added to an executor
Add recursive_mutex to serialize all parameter operations (list, get, set, reset).
Using recursive_mutex because list_parameters() calls cache_default_values() internally.
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist