Description
I would like to have a discussion over implementation of ThreadBasedCyclicSendTask
. The issue there is that if any kind of error happens on the CAN bus, it terminate itself:
python-can/can/broadcastmanager.py
Lines 251 to 253 in b0d7460
I see few issues there:
-
The user (application code actually) is not notified if error happens (
bus.send()
fires exception) during sending periodic messages inThreadBasedCyclicSendTask
, thus application can't handle it properly, for example, restart periodic task after some time. Do I miss something and is this possible? -
It contradicts with a behavior of, for example, SocketCAN implementation of
send_periodic
as it moves responsibility of sending periodic messages to the kernel level, and it is expected that error handling will be done inside the kernel. As tests show, if error on CAN bus happens during usage of native periodic implementation, the periodic tasks are still there and it covers after some time.
Any thoughts on this?