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

RSDK-4447: Allow dial timeout to be configurable #421

Closed
wants to merge 1 commit into from

Conversation

hexbabe
Copy link
Member

@hexbabe hexbabe commented Sep 5, 2023

RSDK-4447

  • Add new instance attribute to DialOptions and use it as kwarg for the socket connection call
  • After making changes to rust utils, pass in timeout into dial method call

@hexbabe hexbabe marked this pull request as ready for review September 5, 2023 18:24
@hexbabe hexbabe requested a review from a team as a code owner September 5, 2023 18:24
@hexbabe hexbabe marked this pull request as draft September 5, 2023 18:24
@@ -66,6 +66,10 @@ class DialOptions:
if detected, even with credentials present. This is generally
unsafe to use, but can be requested."""

timeout: float = 20
"""Number of seconds before the dial connection times out
Set to 20sec to match _defaultOfferDeadline in goutils/rpc/wrtc_call_queue.go"""
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be in the docstring -- it can be a comment, but it doesn't need to be publicly available in the docs

@@ -280,7 +286,7 @@ async def _dial_direct(address: str, options: Optional[DialOptions] = None) -> C

# Test if downgrade is required.
downgrade = False
with socket.create_connection((host, port)) as sock:
with socket.create_connection((host, port), timeout=opts.timeout) as sock:
Copy link
Member

Choose a reason for hiding this comment

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

This is only a test. The real socket connection happens in rust-utils. You'll probably have to change some rust-utils code to accept timeout as a parameter

@njooma
Copy link
Member

njooma commented Sep 11, 2023

Oh sorry just noticed this is still in draft and I probably didn't need to review it just yet oops

@hexbabe hexbabe closed this Sep 13, 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