Skip to content

ThreadBasedCyclicSendTask stops when any error happens on CAN bus #743

Closed
@tysonite

Description

@tysonite

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:

except Exception as exc:
log.exception(exc)
break

I see few issues there:

  1. The user (application code actually) is not notified if error happens (bus.send() fires exception) during sending periodic messages in ThreadBasedCyclicSendTask, thus application can't handle it properly, for example, restart periodic task after some time. Do I miss something and is this possible?

  2. 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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions