hardbyte / hardbyte/python-can

`send_periodic` does not accept `on_error` callback, resulting in race condition

Aperta
#1,282 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
1.6k
Fork
697
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Describe the bug
When setting up a periodic send task there is no way to configure the `on_error` callback in the task. Therefore, if the very first send attempt in the task fails, the task is aborted. This can happen before the user is able to add a callback to the newly created task. Thus there is a race condition between creating the task and sending the first message, and adding the callback.

### To Reproduce
Open a bus and create a periodic task. If sending to the bus fails, the task is aborted due to no callback being configured.

### Expected behavior
An argument is added to `send_periodic` such that the callback can be set in the constructor of the task.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.