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 find-port functions #1824

Merged
merged 1 commit into from
Nov 15, 2018
Merged

Conversation

CriesofCarrots
Copy link
Contributor

Problem

Intermittent errors on find_available_port_in_range, more frequent when using a small range.
Cause: Every pass of the loop randomly selects a port in range without tracking previously tested ports. As a result, the loop may select the same port again and again, and run out of tries before finding a different (open) port.
bind_in_range method has the same issue.

Summary of Changes

After a random initial port selection, each of these methods now loop through all ports in range sequentially.

Fixes #

@CriesofCarrots
Copy link
Contributor Author

fyi, @sagar-solana

@CriesofCarrots CriesofCarrots changed the title Fix find port functions Fix find-port functions Nov 15, 2018
@CriesofCarrots CriesofCarrots merged commit a5412fc into solana-labs:master Nov 15, 2018
@CriesofCarrots CriesofCarrots deleted the netutil branch January 8, 2019 17:32
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Jul 3, 2024
* create solana-atomic-u64 crate

* make reexport public in atomic-u64

* add "For internal use only"

* make required items pub in atomic-u64

* update atomic-u64 usage in solana-program
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