Skip to content

global-monitor: fix crash when IBRL and multicast users share a client IP#3142

Merged
snormore merged 2 commits intomainfrom
snor/fix-global-monitor-duplicate-client-ip
Feb 28, 2026
Merged

global-monitor: fix crash when IBRL and multicast users share a client IP#3142
snormore merged 2 commits intomainfrom
snor/fix-global-monitor-duplicate-client-ip

Conversation

@snormore
Copy link
Contributor

Summary of Changes

  • Fix global monitor crash on startup when a client has both an IBRL and a Multicast user account with the same client IP but connected to different devices (e.g., frankry for IBRL vs fr2-dzx-001 for Multicast)
  • The UsersByClientIP map could arbitrarily return the Multicast user, whose device code mismatches the status device code (which correctly prefers the non-multicast tunnel), causing a fatal "user device code does not match status device code" error
  • Populate User.UserType from onchain data (was previously always zero-value) and prefer non-multicast users in the UsersByClientIP map, matching the existing parseStatus logic

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 1 +23 / -1 +22
Tests 1 +75 / -0 +75

Small targeted bugfix with thorough test coverage.

Key files (click to expand)
  • telemetry/global-monitor/internal/dz/serviceability_test.go — add test for duplicate client IP scenario verifying non-multicast user is preferred
  • telemetry/global-monitor/internal/dz/serviceability.go — populate UserType field, prefer non-multicast user in UsersByClientIP map

Testing Verification

  • Added unit test that creates both multicast and IBRL users with the same client IP on different devices (multicast listed first) and verifies the IBRL user wins in the map
  • All existing serviceability and status tests pass

…xist

When a client has both IBRL and Multicast user accounts sharing the same
client IP, the UsersByClientIP map would keep whichever was iterated last.
If the multicast user won, its device code would mismatch the status
device code (which correctly prefers non-multicast tunnels), crashing the
global monitor on startup.

Populate User.UserType from RPC data and prefer non-multicast users in
the UsersByClientIP map, matching parseStatus behavior.
@snormore snormore enabled auto-merge (squash) February 28, 2026 18:54
@snormore snormore merged commit 8b33a8e into main Feb 28, 2026
30 checks passed
@snormore snormore deleted the snor/fix-global-monitor-duplicate-client-ip branch February 28, 2026 19:31
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.

2 participants