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

Change local RPC port selection logic #1800

Merged
merged 4 commits into from
Apr 27, 2021
Merged

Change local RPC port selection logic #1800

merged 4 commits into from
Apr 27, 2021

Conversation

ConnorMcMahon
Copy link
Contributor

@ConnorMcMahon ConnorMcMahon commented Apr 26, 2021

Current RPC port selection logic favors ephemeral ports. This leads to
issues with the web apps sandbox.

Instead, we now use randomized port selection from an approved range of
ports.

Issue describing the changes in this PR

resolves #1798

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation PR is ready to merge and referenced in pending_docs.md
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
  • I have added all required tests (Unit tests, E2E tests)

Current RPC port selection logic favors ephemeral ports. This leads to
issues with the web apps sandbox.

Instead, we now use randomized port selection from an approved range of
ports.
Copy link
Contributor

@davidmrdavid davidmrdavid left a comment

Choose a reason for hiding this comment

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

LGTM!

numAttempts++;
var random = new Random();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This randomized delay is no longer necessary as we don't have a semi-deterministic mechanism for selecting ports anymore, so it doesn't matter if multiple apps are port-searching at the same time.

@ConnorMcMahon ConnorMcMahon merged commit eb1150c into dev Apr 27, 2021
@ConnorMcMahon ConnorMcMahon deleted the RpcNoEphemeral branch April 27, 2021 17:30
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.

Avoid listening to ephemeral ports for local RPC
4 participants