-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix port conflict error message and cleanup on failure #40102
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
base: feature/wsl-for-apps
Are you sure you want to change the base?
Changes from 5 commits
5a4f763
fbe3b22
e7a0b93
e956563
9cf93d4
a9945f9
d07eb74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1274,12 +1274,10 @@ std::unique_ptr<WSLCContainerImpl> WSLCContainerImpl::Open( | |||||
| { | ||||||
| auto allocation = virtualMachine.TryAllocatePort(e.VmPort, e.Family, e.Protocol); | ||||||
|
|
||||||
| THROW_HR_IF_MSG( | ||||||
| THROW_HR_WITH_USER_ERROR_IF( | ||||||
| HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), | ||||||
| !allocation, | ||||||
| "Port %hu is in use, cannot open container %hs", | ||||||
| e.VmPort, | ||||||
| dockerContainer.Id.c_str()); | ||||||
| std::format(L"Port {} is already in use, cannot open container {}", e.VmPort, dockerContainer.Id), | ||||||
| !allocation); | ||||||
|
Comment on lines
+1277
to
+1280
|
||||||
|
|
||||||
| inserted.VmMapping.AssignVmPort(allocation); | ||||||
| } | ||||||
|
|
@@ -1443,20 +1441,31 @@ void WSLCContainerImpl::MapPorts() | |||||
| auto allocatedPort = | ||||||
| m_virtualMachine.TryAllocatePort(e.ContainerPort, e.VmMapping.BindAddress.si_family, e.VmMapping.Protocol); | ||||||
|
|
||||||
| THROW_HR_IF_MSG( | ||||||
| THROW_HR_WITH_USER_ERROR_IF( | ||||||
| HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), | ||||||
| !allocatedPort, | ||||||
| "Port %hu is in use, cannot start container %hs", | ||||||
| e.ContainerPort, | ||||||
| m_id.c_str()); | ||||||
| std::format(L"Port {} is already in use, cannot start container {}", e.VmMapping.HostPort(), m_id), | ||||||
|
||||||
| std::format(L"Port {} is already in use, cannot start container {}", e.VmMapping.HostPort(), m_id), | |
| std::format(L"Port {} is already in use, cannot start container {}", e.ContainerPort, m_id), |
Uh oh!
There was an error while loading. Please reload this page.