-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ixxat: can.Notifier/Listener stops on too many errors #1643
Comments
I think that behavior was introduced in #1141 |
Unfortunately implementing Listener.on_error() does not help here, because the receive-thread is stopped even when the error is handled. see Line 127 in d81a16b
|
No, the error is raised if the Listeners do not handle the error. |
That's correct, but when |
I see what you mean. The while loop is inside the try-except block. That's not great 🤔 |
I tried your patch and it seems to work as intended (so I can ignore these exceptions and the rx thread will continue), but it doesn't seem to fix actually reading from the bus. Did something w.r.t. the initial configuration of the IXXAT change? e.g. to stop after a certain amount of errors? or disabled automatic error recovery? |
I don't really know anything about the IXXAT implementation. Could you provide a traceback of your errors? |
There is no traceback, but the messages I am waiting for are simply not received (but it works with python-can 3.3.x), instead the log is spammed with the "CAN error: data overrun" warning. When I disable error message generation by removing constants.CAN_OPMODE_ERRFRAME from the initialization, my code works, but I don't think that's the best fix. |
|
Thanks for merging this fix. I will try to find time to debug my remaining problems in more detail and then create a PR or issue depending on the outcome. |
Oh, i didn't actually intend to close this, sorry. Feel free to reopen 😄 |
No its fine. The described problem is gone, so it should be closed :) |
Describe the bug
I am currently porting my application from python-can 3.3.4 to 4.x and noticed that the IXXAT implementation changed quite a lot. The new version raises much more exceptions than before, which breaks my usecase and I am unsure if there is a non-hacky way to get back the old behaviour.
The issue happens when registering a can.Listener/Notifier as a background thread and the IXXAT reports errors (e.g. because another controller on the bus sends something in a different baudrate). In that case an exception is raised in the receiver thread and it stops, which is permanent even if the bus errors recover.
The old implementation would just continue to call recv() till it succeeds and that's the behaviour I rely on in my code. Would it be possible to add e.g. a config flag to ignore such non-fatal errors?
To Reproduce
Nothing special, just a can.Listener/Notifier and another CAN controller with a different baudrate is sending data on the bus.
Expected behavior
Either non-fatal errors should be:
Additional context
OS and version: Windows 10
Python version: 3.9.x
python-can version: 4.2.2
python-can interface/s (if applicable): IXXAT
The text was updated successfully, but these errors were encountered: