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

Destroy service clients explicitely #1944

Closed
wants to merge 1 commit into from

Conversation

christophfroehlich
Copy link
Contributor

While trying to fix ros-controls/ros2_control_demos#666 I found out that the cm service_caller adds a client for every call, but never destroys it.
If the spawner is used with a list of controllers, it will create identical service clients in the same node -> might cause issues.

@christophfroehlich christophfroehlich added the backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. label Dec 15, 2024
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.71%. Comparing base (7374c43) to head (0045673).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
.../controller_manager/controller_manager_services.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1944      +/-   ##
==========================================
- Coverage   87.73%   87.71%   -0.02%     
==========================================
  Files         122      122              
  Lines       13010    13012       +2     
  Branches     1165     1165              
==========================================
  Hits        11414    11414              
- Misses       1165     1166       +1     
- Partials      431      432       +1     
Flag Coverage Δ
unittests 87.71% <50.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
.../controller_manager/controller_manager_services.py 79.01% <50.00%> (-0.37%) ⬇️

... and 1 file with indirect coverage changes

@bijoua29
Copy link
Contributor

@christophfroehlich Looks good to me. Except I may have a related PR that may obviate the need for this PR. If my PR works, I will submit it within the next day. Either way, I will report here. Do you mind waiting a day before merging this PR? It's OK if you don't want to wait too.

@bmagyar
Copy link
Member

bmagyar commented Dec 16, 2024

May also be the reason of some CI flakiness

@christophfroehlich
Copy link
Contributor Author

@bijoua29 I can wait with merging this a bit. We made a change to example_13 tests, let's see if this alone will fix the flaky test there.

@bijoua29
Copy link
Contributor

@christophfroehlich I created #1947 which is in conflict with this PR. Please take a look at that PR. I do clean up the service client there in the destructor which is essentially the gist of this PR. I don't know if it helps or hurts with the flaky tests although I don't see how it would affect the tests.

@christophfroehlich
Copy link
Contributor Author

If there is only a single one per node and service type, then the destruction won't make any difference. But without any change, it happened to have 10 clients and this could be an issue somehow with flaky tests in the ros2_control_demos repo.

@christophfroehlich
Copy link
Contributor Author

fixed with #1949

@christophfroehlich christophfroehlich deleted the cm_services/destroy_client branch December 17, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants