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

Cap UI port at max value #671

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Cap UI port at max value #671

merged 1 commit into from
Sep 17, 2024

Conversation

Sushisource
Copy link
Member

What was changed

Cap maximum UI port value

Why?

Overflow bad

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@Sushisource
Copy link
Member Author

Sushisource commented Sep 16, 2024

Relates to temporalio/sdk-core#816

Comment on lines +76 to +78
if opts.UIPort > 65535 {
opts.UIPort = 65535
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This increases the probability of 65535 being chosen randomly (vs. other port numbers). Can we instead do something like:

Suggested change
if opts.UIPort > 65535 {
opts.UIPort = 65535
}
if opts.UIPort > 65535 {
opts.UIPort = (t.Port - 1024) % (65536 - 1024) + 1024
}

(why keep the if-statement at all? To preserve backward compatibility with the existing +1000 behavior)

Copy link
Member Author

Choose a reason for hiding this comment

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

That's factually true, but, who cares? I can't imagine why that really matters at all.

Copy link
Collaborator

@josh-berry josh-berry left a comment

Choose a reason for hiding this comment

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

Oops I actually meant to approve this before, sorry. Re. the port distribution comment, I don't actually care that much, was just a thought

@Sushisource Sushisource merged commit 469e8cf into main Sep 17, 2024
7 checks passed
@Sushisource Sushisource deleted the cap-ui-port branch September 17, 2024 16:28
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.

3 participants