Skip to content

Duplicate host port#1138

Merged
TimHess merged 8 commits into
release/3.2from
duplicate_host_port
Jul 19, 2023
Merged

Duplicate host port#1138
TimHess merged 8 commits into
release/3.2from
duplicate_host_port

Conversation

@hananiel
Copy link
Copy Markdown
Contributor

@hananiel hananiel commented Jul 6, 2023

Description

Using the extension method UseCloudHosting will ocassionally throw an exception similar to this: 'Failed to bind to address https://127.0.0.1:8083/: address already in use.'

This PR fixes the problem by adds additional filtering for various URL specification to detect duplicates and remove them. In addition when a wild card address is present, it will take precedence over specific ip addresses for a given port.

Quality checklist

  • Your code complies with our Coding Style.
  • You've updated unit and/or integration tests for your change, where applicable.
  • You've updated documentation for your change, where applicable.
    If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
  • You've added required license files and/or file headers (explaining where the code came from with proper attribution), where code is copied from StackOverflow, a blog, or OSS.

@hananiel hananiel added this to the 3.2.4 milestone Jul 6, 2023
@hananiel hananiel self-assigned this Jul 6, 2023
@hananiel hananiel requested review from TimHess and bart-vmware July 6, 2023 20:36
Comment thread src/Common/src/Common.Hosting/HostBuilderExtensions.cs
Comment thread src/Common/src/Common.Hosting/HostBuilderExtensions.cs
@TimHess
Copy link
Copy Markdown
Member

TimHess commented Jul 14, 2023

These changes do appear to fix the issue with no further change, but in my quick testing I think we can simplify further by completely removing references to ASPNETCORE_URLS

Copy link
Copy Markdown
Member

@TimHess TimHess left a comment

Choose a reason for hiding this comment

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

LGTM

@TimHess
Copy link
Copy Markdown
Member

TimHess commented Jul 19, 2023

/azp run Steeltoe.All

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@TimHess TimHess merged commit ea9c195 into release/3.2 Jul 19, 2023
@TimHess TimHess deleted the duplicate_host_port branch July 19, 2023 17:29
@bart-vmware bart-vmware added the ReleaseLine/3.x Identified as a feature/fix for the 3.x release line label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component/Common ReleaseLine/3.x Identified as a feature/fix for the 3.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants