Skip to content

Conversation

@mfaferek93
Copy link
Collaborator

@mfaferek93 mfaferek93 commented Jan 31, 2026

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

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

Testing

How was this tested / how should reviewers verify it?


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

@mfaferek93 mfaferek93 marked this pull request as ready for review January 31, 2026 10:37
Copilot AI review requested due to automatic review settings January 31, 2026 10:37
@mfaferek93 mfaferek93 self-assigned this Jan 31, 2026
@mfaferek93 mfaferek93 added the bug Something isn't working label Jan 31, 2026
Copy link
Contributor

Copilot AI left a 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) in ConfigurationManager.
  • 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.

… 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.
Copy link
Contributor

Copilot AI left a 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.

@mfaferek93 mfaferek93 requested a review from bburda January 31, 2026 13:19
  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.
@mfaferek93 mfaferek93 force-pushed the fix/153/PreventExecutorConflicts branch from d27a343 to 341174e Compare January 31, 2026 14:31
@mfaferek93 mfaferek93 merged commit 26915ab into main Jan 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ConfigurationManager fails with concurrent HTTP requests due to SyncParametersClient executor conflict

3 participants