-
Notifications
You must be signed in to change notification settings - Fork 224
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
[launch_pytest] publishing error: cannot use Destroyable because destruction was requested #1142
Comments
We think this is likely a bug somewhere in |
I sometimes get this error after trying to
I noticed a similar question by @Rezenders that was apparently solved by setting to QoS to unreliable. That would NOT be a good option for my case, but maybe it could point in direction of solution. Can @Rezenders comment on the answer he gave to that question? At a minimum, can we not catch this particular error and ignore? it seems to be case of subscription trying to process a message after destroy has been requested, so I would think just skipping that processing would be the way to go. Is there an easy way to check the if destroy requested and ignore processing after that? I will note that my error above and the original referenced question used a python Thread outside the executors. I'm in the process of reworking my code to avoid this, and only use multithreaded executor and callback groups. It is possible that non-executor thread is the primary trigger for this issue, but seems to be possible with any multithreaded node. I'm willing to do some testing on adding try-except block for my use case, but would like @adityapande-1995 or @clalancette to chime in as this is pretty deep in the weeds for me. No sense wasting time if there are clear reasons they don't want to go that route. |
I am also seeing this same problem in a ros2 tester I'm working on which has to handle services/actions/topics that may not be available. I notice when a service isn't available and I destroy the node with the client while it is waiting for service to respond I hit this error. The node is destroyed in another thread and catching the error and moving on seems OK for my use-case. Using a multi-threaded executor does avoid this problem without any try-exception loops. |
Bug report
Required Info:
Steps to reproduce issue
Similar to this question, I am writing some pytests to test a Node I am developing. I am using launch_pytest to setup the ROS Nodes I want to test. And within a test, I am creating a helper node to publish some messages.
However, I am getting the following error when I publish something with the helper node:
The following exception was never retrieved: cannot use Destroyable because destruction was requested
. The error is triggered with thisnode.diagnostics_pub.publish(diag_msg)
I don' t get any errors when running the node normally, only when testing.
Expected behavior
No error returned
Actual behavior
Error:
[python3-1] The following exception was never retrieved: cannot use Destroyable because destruction was requested
The text was updated successfully, but these errors were encountered: