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

Fix rolling smoke tests crashing #309

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Jun 26, 2024

Changelog

Fix rolling test crashes

Docs

None

Description

Fixes the rolling smoke tests crashing due to incorrect executor cleanup. In the end, the only thing missing was a executor.reset(); at the end of main. However I took the opportunity to clean up a little.

Fixes #304

Copy link

linear bot commented Jun 26, 2024

@achim-k achim-k changed the title Achim/fg 7861 rolling smoke test is crashing on exit Fix rolling smoke tests crashing Jun 26, 2024
@achim-k achim-k requested a review from jtbandes June 26, 2024 21:03
const size_t numThreads = 2;
auto executor =
rclcpp::executors::MultiThreadedExecutor::make_shared(rclcpp::ExecutorOptions{}, numThreads);
auto executor = rclcpp::executors::SingleThreadedExecutor::make_shared();
Copy link
Member

Choose a reason for hiding this comment

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

why change to single threaded?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no good reason actually, just noticed that it also works with a single threaded executor so I left it

@@ -759,6 +757,7 @@ int main(int argc, char** argv) {
const auto testResult = RUN_ALL_TESTS();
executor->cancel();
spinnerThread.join();
executor.reset();
Copy link
Member

Choose a reason for hiding this comment

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

why is this necessary? this is just a shared_ptr right? so even though we already called cancel(), it is problematic to have the object's lifetime last beyond the shutdown() call? Probably could use a comment here because this line seems fairly useless otherwise.

If the lifetime matters so much, can we use make_unique instead of make_shared?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the component manager was still holding on to it which caused issues. I have simplified this now quite a lot and am using the node directly instead of loading it via the component manager.

@achim-k achim-k merged commit d665041 into main Jun 27, 2024
10 checks passed
@achim-k achim-k deleted the achim/fg-7861-rolling-smoke-test-is-crashing-on-exit branch June 27, 2024 06:56
@achim-k achim-k mentioned this pull request Jul 5, 2024
achim-k added a commit that referenced this pull request Jul 5, 2024
### Changelog
* Fix parsing of IDL message definitions (#313)
* Support publishing client message as loaned message (#314)
* fix: remove extra ";" in websocket_server.hpp (#311)
* Fix rolling smoke tests crashing (#309)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Rolling smoke test is crashing on exit
2 participants