Skip to content

Add loopback fallback when local IP discovery finds no candidates - #9926

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:fix/macos-local-ip-fallback
Feb 16, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:fix/macos-local-ip-fallback

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Feb 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a local-address resolution helper in ConfigUtilities
  • fall back to IPv4/IPv6 loopback when no candidate address is discovered and no explicit interface is configured
  • preserve existing exception behavior when NetworkInterfaceName is explicitly set
  • add regression tests in NonSilo.Tests for IPv4 fallback, IPv6 fallback, and explicit-interface failure

Testing

  • dotnet test test\NonSilo.Tests\NonSilo.Tests.csproj --filter "FullyQualifiedName~Config_LocalIPAddressFallback" -v minimal --nologo
  • dotnet test test\TesterInternal\TesterInternal.csproj --filter "FullyQualifiedName~DisabledCallChainReentrancyTests.NonReentrantGrain" -v minimal --nologo
Microsoft Reviewers: Open in CodeFlow

Use family-specific loopback when automatic local address discovery returns no candidates and no interface is explicitly configured, preventing client startup failures on macOS CI runners. Preserve existing failure behavior when an explicit interface name is configured. Add ConfigTests coverage for IPv4 fallback, IPv6 fallback, and explicit-interface exceptions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 16, 2026 17:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds loopback fallback functionality to Orleans' local IP address discovery, improving robustness when running in containerized or restricted network environments. When no network interface candidates are discovered and no explicit interface name is configured, the system now gracefully falls back to IPv4 or IPv6 loopback addresses instead of failing with an exception.

Changes:

  • Extracted IP address resolution logic into a new testable ResolveLocalIPAddress method in ConfigUtilities
  • Added loopback fallback for IPv4 (IPAddress.Loopback) and IPv6 (IPAddress.IPv6Loopback) when no candidates are found and no explicit interface is configured
  • Preserved existing exception behavior when NetworkInterfaceName is explicitly set but no matching interface is found
  • Added comprehensive unit tests covering IPv4 fallback, IPv6 fallback, and explicit interface failure scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Orleans.Core/Configuration/ConfigUtilities.cs Refactored GetLocalIPAddress to delegate to new ResolveLocalIPAddress method; added loopback fallback logic for IPv4/IPv6 address families when no candidates exist and no explicit interface is configured
test/NonSilo.Tests/ConfigTests.cs Added three unit tests verifying IPv4 loopback fallback, IPv6 loopback fallback, and exception throwing for explicit interface configuration with no candidates

Comment thread test/NonSilo.Tests/ConfigTests.cs Resolved
@ReubenBond
ReubenBond added this pull request to the merge queue Feb 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Feb 16, 2026
@ReubenBond
ReubenBond added this pull request to the merge queue Feb 16, 2026
Merged via the queue into dotnet:main with commit 0f69beb Feb 16, 2026
65 checks passed
@ReubenBond
ReubenBond deleted the fix/macos-local-ip-fallback branch February 16, 2026 22:55
rkargMsft pushed a commit to rkargMsft/orleans that referenced this pull request Feb 27, 2026
…tnet#9926)

Add loopback fallback for local IP discovery

Use family-specific loopback when automatic local address discovery returns no candidates and no interface is explicitly configured, preventing client startup failures on macOS CI runners. Preserve existing failure behavior when an explicit interface name is configured. Add ConfigTests coverage for IPv4 fallback, IPv6 fallback, and explicit-interface exceptions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants