Revert "Added API to set ephemeral port allocator range."#43066
Conversation
abbf0c0 to
0cbc1f3
Compare
neersighted
left a comment
There was a problem hiding this comment.
This looks really clean from a revert/application standpoint. However, I do wonder if it is desirable to reintroduce the ability to set the range over the API in a way that is documented and falls back to the kernel parameter as a default?
Regardless, this is aligned with the documented behavior and the right move given this has manifested as a regression for users.
|
(This needs a rebase for some conflicts, but they look like they're pretty minor -- just the |
Since commit 2c4a868, Docker doesn't use the value of net.ipv4.ip_local_port_range when choosing an ephemeral port. This change reverts back to the previous behavior. Fixes moby#43054. Signed-off-by: Albin Kerouanton <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
| logrus.WithError(err).Infof("falling back to default port range %d-%d", defaultPortRangeStart, defaultPortRangeEnd) | ||
| start, end = defaultPortRangeStart, defaultPortRangeEnd | ||
| logrus.WithError(err).Infof("falling back to default port range %d-%d", DefaultPortRangeStart, DefaultPortRangeEnd) | ||
| start, end = DefaultPortRangeStart, DefaultPortRangeEnd |
There was a problem hiding this comment.
Looks like these consts aren't used outside of the package, so I guess we can keep those
|
Doing a quick rebase, and I'll add a commit to keep the consts un-exported |
|
Ah, sorry @thaJeztah, didn't had time to rebase it today. Thanks for doing it 🙂 |
|
No worries! (apologies on our side for this have taken so long!) |
| // consistent with default /proc/sys/net/ipv4/ip_local_port_range | ||
| // upper bound on linux | ||
| defaultPortRangeEnd = 60999 | ||
| defaultPortRangeEnd = 65535 |
There was a problem hiding this comment.
Let me comment on this line; this may have been related to #40055 (comment) as well (in case we need to un-revert this change in range)
/cc @neersighted @corhere @evol262
(and myself, for if this causes havoc in our products 🙈)
|
Failure is unrelated; known flaky test (#38521) |
- What I did
Since commit 2c4a868, Docker doesn't
use the value of net.ipv4.ip_local_port_range when choosing an ephemeral
port. This change reverts back to the previous behavior.
Fixes #43054.
- How to verify it
make shellsysctl -w net.ipv4.ip_local_port_range="39000 40000"docker run --rm -it -p 80 nginxdocker ps- Description for the changelog
Use the value of net.ipv4.ip_local_port_range when choosing an ephemeral port