ros2_rust
ros2_rust copied to clipboard
Panicking inside a worker causes waitset error.
This has to do with the newly introduced async-worker API. If I panic inside a worker subscriber I get the error:
[FATAL] [1749692769.253571881] [rclrs.basic_executor]: WaitSetRunner unexpectedly dropped. This should never happen. Please report this to the rclrs maintainers with a minimal reproducible example.
It's a bit weird because the entire node does not die but just sits there. I'll post a minimal reproducible example in a bit.
Ah I believe the panic is killing the thread that the worker is on, but the panic is kept isolated to that thread.
We should use catch_unwind while processing all callbacks to manage this situation correctly. Then the question is whether a worker that experiences a panic in its callback should force the executor to exit with an error or just keep chugging along. This may be a good candidate for WorkerOptions.