Skip to content

Conversation

@wchargin
Copy link
Contributor

Summary:
In response to a helpful post-commit review from @nfelt.

Test Plan:
Most of the changes are non-functional. The wildcard address resolution
logic did change, but we don’t expect the behavior to. The test plan
from #1851 suffices, plus explicitly binding --host to each of
localhost, "$(hostname)", "$(hostname -s)", 127.0.0.1, and ::
to verify that each works.

wchargin-branch: port-search-revisions

wchargin-branch: port-search-revisions
wchargin-branch: port-search-revisions
wchargin-branch: port-search-revisions
wchargin-branch: port-search-revisions
)
max_attempts = 10 if should_scan else 1
base_port = min(base_port + max_attempts, 65536) - max_attempts
base_port = min(base_port + max_attempts, 0x10000) - max_attempts
Copy link
Contributor

Choose a reason for hiding this comment

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

Re-reading this logic, is this line really necessary? It can't actually be reached in the current code, it would only happen if we set the default base_port to a number within 10 of 65536.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That’s correct. I should add to the test plan that I did in fact test
this by changing the core_plugin.DEFAULT_PORT to 65534 and observing
that it binds to 65526 instead.

(Arguably it would be nicer to count down in such a case, but for code
that is never executed I have a limited budget for aesthetics.)

@wchargin wchargin merged commit dd83886 into master Feb 16, 2019
@wchargin wchargin deleted the wchargin-port-search-revisions branch February 16, 2019 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants