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

ContainerStart must run sequentially for engine to assing distinct ports within configured range #10067

Merged
merged 1 commit into from Dec 12, 2022

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Dec 12, 2022

What I did
A service configured with port: 6000-6010:80 will get a random port assigned within this range
As we invoke ContainerStart, engine select an available port within container's config port range.
If we invoke those concurrently for containers within same service, engine will fail to assign a distinct port.
Arguably, engine should manage concurrent access and prevent this to happen, but .. ¯\(ツ)/

Related issue
fixes #8530

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

…rts within configured range

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Base: 75.74% // Head: 77.02% // Increases project coverage by +1.27% 🎉

Coverage data is based on head (4b6f63a) compared to base (8f991a2).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10067      +/-   ##
==========================================
+ Coverage   75.74%   77.02%   +1.27%     
==========================================
  Files           2        2              
  Lines         235      235              
==========================================
+ Hits          178      181       +3     
+ Misses         50       48       -2     
+ Partials        7        6       -1     
Impacted Files Coverage Δ
pkg/e2e/framework.go 75.22% <0.00%> (+1.37%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM, I'm little bit sad to see this move but I definitely prefer lower perf than port collisions 🤷‍♂️

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

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

LGTM

@NicolaeBasso
Copy link

Is there a solution for compose V3 without adding containerized NGINX, for example?
This has been an issue for years already looks like..

@pribic
Copy link

pribic commented Mar 16, 2024

I am still getting the port mapping error on windows. Here is the version:

 >docker-compose -v
Docker Compose version v2.24.6-desktop.1

is it fixed for above version?

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.

docker-compose V2 fails for port range and replicas>1 where V1 would succeed
5 participants