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

fix: Let wait_for_ecu() reconnect on all ConnectionErrors incl. hidden #678

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

ferdinandjarisch
Copy link
Contributor

Currently, a broken transport triggers a reconnect in request_unsafe(), but only in case of retries. Since wait_for_ecu specifically sets retries to 0 this is not happening and instead ConnectionErrors are transformed to UDSExceptions.
This commit brings two major changes:

  1. request_unsafe sets the cause of the MissingResponse to ConnectionError to provide callers with additional information
  2. wait_for_ecu treats a MissingRespone caused by a ConnectionError the same as a ConnectionError and calls reconnect

Currently, a broken transport triggers a reconnect in request_unsafe(),
but only in case of retries. Since wait_for_ecu specifically sets
retries to 0 this is not happening and instead ConnectionErrors are
transformed to UDSExceptions.
This commit brings two major changes:

1. `request_unsafe` sets the __cause__ of the MissingResponse to
   ConnectionError to provide callers with additional information
2. `wait_for_ecu` treats a MissingRespone caused by a ConnectionError
   the same as a ConnectionError and calls reconnect
@ferdinandjarisch ferdinandjarisch merged commit 1ac3519 into master Feb 4, 2025
14 checks passed
@ferdinandjarisch ferdinandjarisch deleted the fix-wait-for-ecu branch February 4, 2025 12:11
@rumpelsepp rumpelsepp added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants