Skip to content

Improve logging for Cluster.Bootstrap hostname matching diagnostics#3388

Merged
Aaronontheweb merged 1 commit intoakkadotnet:devfrom
Aaronontheweb:feature/improve-bootstrap-hostname-logging
Oct 27, 2025
Merged

Improve logging for Cluster.Bootstrap hostname matching diagnostics#3388
Aaronontheweb merged 1 commit intoakkadotnet:devfrom
Aaronontheweb:feature/improve-bootstrap-hostname-logging

Conversation

@Aaronontheweb
Copy link
Copy Markdown
Member

Summary

Addresses #3387 by adding detailed diagnostic logging to help debug hostname/IP mismatch issues during cluster bootstrap.

Changes

  1. HostMatches method - Added DEBUG logging showing:

    • Self hostname being compared
    • Target hostname from discovery
    • Target IP address (if available)
    • Direct string match result
    • Contains match result
    • Final match result
  2. MatchesSelf method - Added DEBUG logging for the edge case where hostname matches but port doesn't

  3. CanJoinSelf warning - Enhanced to separately display hostname and port values when self contact point is not found in discovered targets

  4. AkkaManagement binding log - Now shows the advertised hostname alongside the bind address to clarify the difference

Example Logs

Before:

[INFO] Binding Akka Management (HTTP) endpoint to: 0.0.0.0:8558
[INFO] Located service members based on: [Lookup(drawtogether, management, tcp)]: [ResolvedTarget(10.1.2.138, 8558, 10.1.2.138)], filtered to [10.1.2.138:8558]
[INFO] Contact point [akka.tcp://DrawTogether@drawtogether-0.drawtogether:5055] returned [0] seed-nodes []

After (with DEBUG enabled):

[INFO] Binding Akka Management (HTTP) endpoint to: 0.0.0.0:8558, advertising as hostname: drawtogether-0.drawtogether
[DEBUG] HostMatches comparison: self hostname='drawtogether-0.drawtogether', target hostname='10.1.2.138', target address='10.1.2.138', direct match=False, contains match=False, result=False
[WARN] Self contact point [drawtogether-0.drawtogether:8558] (hostname: drawtogether-0.drawtogether, port: 8558) not found in targets [10.1.2.138:8558]

Testing

No new tests required - these are purely observability improvements that don't change any logic or require infrastructure modifications.

Fixes #3387

Added detailed DEBUG logging to help diagnose hostname/IP mismatch issues during cluster bootstrap:

- HostMatches: Log detailed comparison results showing self hostname, target hostname, target IP, direct match result, contains match result, and final result
- MatchesSelf: Log when hostname matches but port mismatches occur
- CanJoinSelf: Enhanced warning to separately display hostname and port values when self contact point is not found in discovered targets
- AkkaManagement binding: Log the advertised hostname alongside the bind address to clarify the difference between bind and advertised addresses

These improvements make it immediately clear in the logs when hostname/IP mismatches prevent successful cluster formation, addressing issues where the self contact point uses a hostname but discovery returns IPs (or vice versa).

Fixes akkadotnet#3387
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.

Improve Akka.Management logging for debugging Cluster.Bootstrap hostname matching issues

1 participant