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

Deployments do not call stopHook on running tasks on exit #16

Open
pierrewillenbrockdfki opened this issue Nov 27, 2023 · 0 comments
Open

Comments

@pierrewillenbrockdfki
Copy link
Contributor

Using any deployment with at least one task, starting said task by whatever means, said task does not have its stopHook and similar called when the deployment is terminated(using SIGINT, SIGTERM and similar).

The owner of the tasks, ORO_main()/ORO_main_impl(), does not do anything special to the tasks, except run their destructor through std::unique_ptr. ORO_main()/ORO_main_impl() does stop() their associated Activitys.

On the RTT side, the Tasks parent classes TaskContext and TaskCore cannot run the hooks in their destructors, since the child object has technically already been deconstructed and thus the virtual methods are no longer available. The Activitys only call into ExecutionEngine::finalize(), which does nothing. ExecutionEngine is the bit that knows about the task from an Activitys point of view.

The solution for this could be to have the ORO_main()/ORO_main_impl() run the tasks state machines using its Deinitializer, like it already does for the Activitys it creates.

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

No branches or pull requests

1 participant