fix(gateway): #153 serialize parameter operations to prevent executor…#154
Merged
mfaferek93 merged 2 commits intomainfrom Jan 31, 2026
Merged
fix(gateway): #153 serialize parameter operations to prevent executor…#154mfaferek93 merged 2 commits intomainfrom
mfaferek93 merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
bburda
reviewed
Jan 31, 2026
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
bburda
approved these changes
Jan 31, 2026
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
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