Skip to content

Fix reconnect logic #447

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

Merged
merged 2 commits into from
Sep 28, 2023
Merged

Fix reconnect logic #447

merged 2 commits into from
Sep 28, 2023

Conversation

cheukt
Copy link
Member

@cheukt cheukt commented Sep 27, 2023

  • sessions client was overwriting dial options in the robot client, so making an actual copy
  • on reconnect, sessions client actually wants the new socket address, so got that instead of the address of the robot itself

@cheukt cheukt requested a review from a team as a code owner September 27, 2023 23:09
@cheukt cheukt requested review from clintpurser, benjirewis and maximpertsov and removed request for clintpurser September 27, 2023 23:09
Comment on lines 53 to 61
if dial_options is not None:
self._dial_options = DialOptions(
disable_webrtc=True,
auth_entity=dial_options.auth_entity,
credentials=dial_options.credentials,
insecure=dial_options.insecure,
allow_insecure_downgrade=dial_options.allow_insecure_downgrade,
allow_insecure_with_creds_downgrade=dial_options.allow_insecure_with_creds_downgrade,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use deepcopy here (from copy import deepcopy), otherwise we'll need to remember to add new dial option fields here too.

Suggested change
if dial_options is not None:
self._dial_options = DialOptions(
disable_webrtc=True,
auth_entity=dial_options.auth_entity,
credentials=dial_options.credentials,
insecure=dial_options.insecure,
allow_insecure_downgrade=dial_options.allow_insecure_downgrade,
allow_insecure_with_creds_downgrade=dial_options.allow_insecure_with_creds_downgrade,
)
if dial_options is not None:
self._dial_options = deepcopy(dial_options)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@cheukt cheukt requested a review from maximpertsov September 28, 2023 16:07
self._dial_options = DialOptions(disable_webrtc=True)

self._dial_options = deepcopy(dial_options) if dial_options is not None else DialOptions()
self._dial_options.disable_webrtc = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice, yeah i forgot we always want webrtc disabled here - good catch

@cheukt cheukt merged commit 36c27e3 into viamrobotics:main Sep 28, 2023
@cheukt cheukt deleted the fix-reconnect-logic branch September 28, 2023 16:15
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