Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Finalize context if and only if it's shutdown #428

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Jun 22, 2020

This pull request, albeit controversial, ensures rmw_context_fini() fails on a not shutdown context, as its API contract establishes (see ros2/rmw#242).

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested review from wjwwood and ivanpauno June 22, 2020 15:17
return init();
ret = init();
if (RMW_RET_OK != ret) {
if (RMW_RET_OK != rmw_init_options_fini(&context->options)) {
Copy link
Member

Choose a reason for hiding this comment

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

this seem unrelated to the PR.
IMO, it should be done in another PR, or in a separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is fair, yeah. I came across leaks and I couldn't help it.

@hidmic hidmic force-pushed the hidmic/safe-context-finalization branch from ca17974 to 6cf827e Compare June 22, 2020 17:42
@hidmic hidmic requested a review from ivanpauno June 22, 2020 18:36
@hidmic
Copy link
Contributor Author

hidmic commented Jun 22, 2020

CI up to test_rmw_implementation against all RMW implementations:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@ivanpauno
Copy link
Member

ivanpauno commented Jun 22, 2020

CI up to test_rmw_implementation against all RMW implementations:

I would run tests up to an upper layer, like test_rclcp, just in case.
At least in one platform.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Jun 23, 2020

Alright, going in.

@hidmic hidmic merged commit f118066 into master Jun 23, 2020
@delete-merged-branch delete-merged-branch bot deleted the hidmic/safe-context-finalization branch June 23, 2020 15:30
ahcorde pushed a commit that referenced this pull request Oct 8, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ahcorde pushed a commit that referenced this pull request Oct 15, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants