Skip to content

(windows) Pick a random host port if the user does not specify a host port. #2368

Merged
mavenugo merged 1 commit intomoby:masterfrom
pradipd:WindowsPortMappingFix
Apr 23, 2019
Merged

(windows) Pick a random host port if the user does not specify a host port. #2368
mavenugo merged 1 commit intomoby:masterfrom
pradipd:WindowsPortMappingFix

Conversation

@pradipd
Copy link
Contributor

@pradipd pradipd commented Apr 19, 2019

For overlay, l2bridge, and l2tunnel, if the user does not specify a host port, windows driver will select a random port for them. This matches linux behavior.
For ics and nat networks the windows OS will choose the port.

Signed-off-by: Pradip Dhara [email protected]

@pradipd
Copy link
Contributor Author

pradipd commented Apr 19, 2019

@mavenugo PTAL.

@pradipd pradipd force-pushed the WindowsPortMappingFix branch 2 times, most recently from 7e6982e to 43a5636 Compare April 19, 2019 21:47
Copy link
Contributor

@mavenugo mavenugo left a comment

Choose a reason for hiding this comment

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

LGTM with a minor comment.

@pradipd can you pls address the minor comment ?

For overlay, l2bridge, and l2tunnel, if the user does not specify a host port, windows driver will select a random port for them.  This matches linux behavior.
For ics and nat networks the windows OS will choose the port.

Signed-off-by: Pradip Dhara <[email protected]>
@pradipd pradipd force-pushed the WindowsPortMappingFix branch from 43a5636 to e6b4a7a Compare April 22, 2019 17:43
@andrewhsu
Copy link
Contributor

Looks like unit tests still failing.

Looking to get this backported to bump_18.09 when this PR is ready.

@pradipd
Copy link
Contributor Author

pradipd commented Apr 23, 2019

I can't get a local repro.
I'm stuck on:
Could not get ipvs family information from the kernel. It is possible that ipvs is not enabled in your kernel. Native loadbalancing will not work until this
--- FAIL: TestService (0.00s)

I'm running on Ubuntu 16.04. What do I need to do to move past this?

@thaJeztah
Copy link
Member

Could someone restart CI on this one, or could this be an actual issue?

Makefile:123: recipe for target 'unit-tests' failed
make: *** [unit-tests] Terminated
Too long with no output (exceeded 10m0s)

If this is due to flakiness / slow runs, there's a configuration option to extend the timeout (see docker/cli#1750, where I raised it for docker/cli)

@mavenugo
Copy link
Contributor

I restarted the CI again. The flakiness doesnt seem to be related. But let me give it another go.

@thaJeztah
Copy link
Member

CI is green now 👍


const (
StartPortRange = 60000
EndPortRange = 65000
Copy link
Member

Choose a reason for hiding this comment

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

Looks like these don't have to be exported

Also; given that constants are assigned for these, I assume there's no configurable ephemeral port range on Windows (as there's on Linux)?

Copy link
Member

Choose a reason for hiding this comment

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

@mavenugo mavenugo merged commit 9ff9b57 into moby:master Apr 23, 2019
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Apr 23, 2019
full diff: moby/libnetwork@c902989...872f0a8

- moby/libnetwork#2354 [18.09 backport] Cleanup the cluster provider when the agent is closed
  - backport of moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart
  - fixes docker/for-linux#495 Docker swarm overlay networking not working after --force-new-cluster
- moby/libnetwork#2369 [18.09 BACKPORT] Pick a random host port if the user does not specify a host port
  - backport of moby/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Apr 23, 2019
full diff: moby/libnetwork@48f8463...9ff9b57

- moby/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port

Signed-off-by: Sebastiaan van Stijn <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Apr 23, 2019
full diff: moby/libnetwork@c902989...872f0a8

- moby/libnetwork#2354 [18.09 backport] Cleanup the cluster provider when the agent is closed
  - backport of moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart
  - fixes docker/for-linux#495 Docker swarm overlay networking not working after --force-new-cluster
- moby/libnetwork#2369 [18.09 BACKPORT] Pick a random host port if the user does not specify a host port
  - backport of moby/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: 5354408039681020f9ad6afe4bf696fc90f9ce69
Component: engine
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Apr 24, 2019
full diff: moby/libnetwork@48f8463...9ff9b57

- moby/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: 7f2c564b23377e1c69bc06e40fef1a459d6f51b5
Component: engine
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.

5 participants