ros2_rust icon indicating copy to clipboard operation
ros2_rust copied to clipboard

Panicking inside a worker causes waitset error.

Open arjo129 opened this issue 5 months ago • 1 comments

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.

arjo129 avatar Jun 12 '25 01:06 arjo129

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.

mxgrey avatar Jun 12 '25 02:06 mxgrey