Skip to content

Keep gravity reconnects on discovered endpoints#237

Closed
jhaynie wants to merge 6 commits intomainfrom
fix/gravity-bound-tunnel-fallback
Closed

Keep gravity reconnects on discovered endpoints#237
jhaynie wants to merge 6 commits intomainfrom
fix/gravity-bound-tunnel-fallback

Conversation

@jhaynie
Copy link
Copy Markdown
Member

@jhaynie jhaynie commented Apr 28, 2026

Summary

  • keep multi-endpoint Gravity reconnects on the discovered direct endpoint set
  • avoid collapsing direct per-Ion endpoints back to the shared bootstrap/NLB address during reconnect
  • add a regression test covering the direct-endpoint-to-bootstrap collapse case

Validation

  • go test ./gravity -run 'TestReResolveEndpointURL_PrefersDiscoveredDirectEndpointsOverBootstrapDNS|TestReResolveEndpointURL_'
  • go test ./gravity

Summary by CodeRabbit

  • Improvements

    • Enhanced endpoint re-resolution logic to better handle multi-endpoint configurations by prioritizing discovered endpoints and reducing unnecessary DNS lookups.
  • Tests

    • Added test coverage for endpoint re-resolution with discovered endpoints.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1963692c-e26b-4876-b6e3-0864beccf1be

📥 Commits

Reviewing files that changed from the base of the PR and between 6638d0e and 008e73f.

📒 Files selected for processing (2)
  • gravity/grpc_client.go
  • gravity/reresolve_test.go

📝 Walkthrough

Walkthrough

Adds endpoint re-resolution logic to prioritize discovered direct endpoints over DNS/TLSServerName fallback. Introduces helper method reResolveFromDiscoveredSet to evaluate discovered URLs and prevent collapsing multiple direct endpoints onto a shared address, with corresponding unit test validation.

Changes

Cohort / File(s) Summary
Endpoint Re-resolution Enhancement
gravity/grpc_client.go, gravity/reresolve_test.go
Implements new reResolveFromDiscoveredSet helper that prioritizes discovered endpoints in multi-endpoint mode to avoid DNS re-resolution collapsing multiple direct endpoints. Includes unit test validating correct behavior when discovered endpoints already cover the endpoint pool, ensuring no unintended DNS lookups occur.

Comment @coderabbitai help to get the list of available commands and usage tips.

@jhaynie jhaynie closed this Apr 28, 2026
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.

1 participant