Skip to content

fix: honor randomized_port_min and randomized_port_max - #4

Closed
CorentinFelten wants to merge 1 commit into
masterfrom
fix/random-port-range
Closed

CorentinFelten wants to merge 1 commit into
masterfrom
fix/random-port-range

Conversation

@CorentinFelten

Copy link
Copy Markdown
Owner

Fork-internal PR, only to run Galvanize's CI on this branch. Not to be merged into the fork.

The randomized host port range was read from the config but never
used: both allocators, the port bindings store used for deployments
and the in-memory one, hard-coded 20000-60999.

- InstancerConfig.RandomizedPortRange returns the configured range,
  each bound defaulting to 20000 and 60999 when unset, and Validate
  rejects a range outside 1-65535 or with the minimum above the
  maximum; Load calls it, so startup fails on an invalid range and a
  reload with one keeps the current config.
- Both allocators pick from that range. The store tries 128 random
  ports, then takes the first port no binding uses, so a nearly full
  range is still used up.
- A deployment that cannot get a host port (no free port left, or the
  store cannot be opened) now fails with an error naming the range,
  instead of leaving the container port to an ephemeral host port
  outside it.
@CorentinFelten

Copy link
Copy Markdown
Owner Author

Superseded by #6, which combines all five fixes into one branch for the upstream PR.

CorentinFelten added a commit that referenced this pull request Oct 1, 2026
@CorentinFelten
CorentinFelten deleted the fix/random-port-range branch October 1, 2026 23:16
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.

1 participant