Skip to content
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

Catch and re-raise CancelledError #77

Closed
wants to merge 4 commits into from
Closed

Conversation

alexrudd2
Copy link
Member

See https://github.com/numat/controllers/issues/1596

@juli4nb4dillo
I prefer this approach to catching CancelledError in the controllers.
(1) The docs strongly advise against swallowing CancelledError
(2) We know that raising TimeoutError works without killing the controller.

@juli4nb4dillo
Copy link
Member

juli4nb4dillo commented Aug 22, 2023

It may work unless the CancelledError is raised on the await self.connectTask
Can we leave a trace of the error captured? In case we need to debug if it was a Cancel, Timeout or Connect error?

clickplc/util.py Outdated Show resolved Hide resolved
Co-authored-by: Julian Badillo <j.badillo@numat-tech.com>
@alexrudd2
Copy link
Member Author

@juli4nb4dillo This appears to be working well. (I just watched trim1 cycle through.)
However, Jan is talking about releasing pymodbus soon. He moves fast so my guess is this week.

There's a slight chance this is relevant: pymodbus-dev/pymodbus#1702

Anyways, let's keep this running a bit until the new release.

@alexrudd2
Copy link
Member Author

Closing in favor of approaches discussed in https://github.com/numat/controllers/issues/1596

@alexrudd2 alexrudd2 closed this Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants