Skip to content

Fix for Windows port conflict with published ports in host mode for overlay. #43634

Merged
thaJeztah merged 2 commits intomoby:masterfrom
ameyag:win-port-conflict
May 25, 2022
Merged

Fix for Windows port conflict with published ports in host mode for overlay. #43634
thaJeztah merged 2 commits intomoby:masterfrom
ameyag:win-port-conflict

Conversation

@ameyag
Copy link
Copy Markdown
Contributor

@ameyag ameyag commented May 23, 2022

- What I did

The libnetwork logic uses a dummy proxy to bind the ports for communication between container and host. WS 2019 Aug 2020 patch onwards, Windows started doing an early port reservation which conflicts with the aforementioned logic for overlay and host publish mode for the ports. The bug is now applicable to current patched Windows >= WS 2019. Thus, making a change to address the race with recent changes on the Windows side.

Fixes: #42811

cc @dcantah @kestratt

- How I did it

- How to verify it

  • I verified it with private hostnetsvc.dll from Windows team. The corresponding change for Windows will be available in the subsequent patch releases.

- Description for the changelog

  • Moby side fix to address port conflict for Windows with published ports in host mode for overlay.

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Ameya Gawde <agawde@mirantis.com>
@thaJeztah
Copy link
Copy Markdown
Member

Curious; Does the same approach work for older versions of Windows (RS5?) or is it just ignored on those?

@ameyag
Copy link
Copy Markdown
Contributor Author

ameyag commented May 23, 2022

Curious; Does the same approach work for older versions of Windows (RS5?) or is it just ignored on those?

It doesn't regress the old versions of Windows (pre Aug2020-RS5/RS1). The flag is ignored.

@ameyag
Copy link
Copy Markdown
Contributor Author

ameyag commented May 23, 2022

Looking into TestRequestReleaseAddressDuplicate failure.

@ameyag
Copy link
Copy Markdown
Contributor Author

ameyag commented May 23, 2022

TestRequestReleaseAddressDuplicate failure doesn't look related. @thaJeztah - would it be possible to rekick the CI?

@thaJeztah
Copy link
Copy Markdown
Member

Ah, sure; gave it a kick

@ameyag
Copy link
Copy Markdown
Contributor Author

ameyag commented May 23, 2022

Windows CI is green now. The earlier Windows failed test seems to be flaky.

@thaJeztah thaJeztah added this to the 22.06.0 milestone May 24, 2022
@ameyag ameyag force-pushed the win-port-conflict branch 5 times, most recently from d66c0d6 to adea710 Compare May 25, 2022 05:33
Signed-off-by: Ameya Gawde <agawde@mirantis.com>
@ameyag ameyag force-pushed the win-port-conflict branch from adea710 to cba8cf3 Compare May 25, 2022 14:13
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM (sorry, thought I already did when I kicked CI 🙈)

@thaJeztah
Copy link
Copy Markdown
Member

All green; codecov check seems broken, so ignoring that one

@olljanat
Copy link
Copy Markdown
Contributor

I verified it with private hostnetsvc.dll from Windows team. The corresponding change for Windows will be available in the subsequent patch releases.

@ameyag did you got information from Microsoft about which KB should include that patch?

People are still complaining about this issue with Docker version which should contain this fix #42811 (comment)

@ameyag
Copy link
Copy Markdown
Contributor Author

ameyag commented Jul 20, 2022

It was supposed to be released today but the recent ETA I received from Microsoft is 2pm PST July 26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker Swarm + Windows Server 2022. Can't start connected to overlay network container with published ports (host mode)

5 participants