Skip to content
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

Update spawner to have a timeout on service call #1566

Closed
wants to merge 2 commits into from

Conversation

gennartan
Copy link

@gennartan gennartan commented Jun 7, 2024

In some cases, the service call might never return. As a consequence, the call to spin_until_future_complete will loop infinitely.

When the error happens:

  • The spawner is blocked
  • The controller manager shows the following error: [controller_manager.rclcpp]: failed to send response to /controller_manager/list_controllers (timeout): client will not receive response, at ./src/rmw_response.cpp:154, at ./src/rcl/service.c:402

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

  1. Limited scope. Your PR should do one thing or one set of things. Avoid adding “random fixes” to PRs. Put those on separate PRs.
  2. Give your PR a descriptive title. Add a short summary, if required.
  3. Make sure the pipeline is green.
  4. Don’t be afraid to request reviews from maintainers.
  5. New code = new tests. If you are adding new functionality, always make sure to add some tests exercising the code and serving as live documentation of your original intention.

To send us a pull request, please:

  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

Copy link

codecov bot commented Jun 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.64%. Comparing base (af4b48f) to head (e25efe8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1566      +/-   ##
==========================================
- Coverage   86.67%   86.64%   -0.03%     
==========================================
  Files         115      115              
  Lines       10528    10529       +1     
  Branches      967      967              
==========================================
- Hits         9125     9123       -2     
- Misses       1056     1058       +2     
- Partials      347      348       +1     
Flag Coverage Δ
unittests 86.64% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../controller_manager/controller_manager_services.py 67.74% <100.00%> (ø)

... and 1 file with indirect coverage changes

@fmauch
Copy link
Contributor

fmauch commented Jun 10, 2024

Related: #1501

In some cases, the service call might never return. As a consequence,
the call to spin_until_future_complete will loop infinitely.

Signed-off-by: agennart <antoine.gennart@quimesis.be>
@gennartan
Copy link
Author

gennartan commented Jun 11, 2024

Related: #1501

Yes, PR #1501 seems to add the usage of timeout_sec of spin_until_future_complete as I did here. With two main differences:

I don't know what would be the expected behavior from the maintainers. It is up to them to decide which behavior is prefered.

That said, I think merging one of those PR could be a priority since it is a bug in ros2_control that can prevent a robot to start. In my case, I am starting the spawner in a launchfile and in about 30% of the cases, I must manually restart the spawner because the node didn't start correctly. Other projects in my company had the same issues.

@destogl
Copy link
Member

destogl commented Aug 14, 2024

Closing in favor of #1501 (decided on WG Meeting Aug. 14th)

@destogl destogl closed this Aug 14, 2024
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.

3 participants