Skip to content

feat(guest_service): resolve a relay's target per connection - #214

Merged
markovejnovic merged 1 commit into
mainfrom
feat/relay-resolve-target
Dec 2, 2026
Merged

markovejnovic merged 1 commit into
mainfrom
feat/relay-resolve-target

Conversation

@markovejnovic

@markovejnovic markovejnovic commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Originally, Hyper.Relay required that you pass the pid of the process to relay to. Unfortunately, this is not a great system.

In the case of a relay server crashing, the handler would have a sticky pid. Now, if a relay server crashes, the connection is terminated (this did not change), however, on a subsequent connection, we re-invoke GenServer.whereis, which enables the receiver to restart to a new server PID.

A relay's target can be any GenServer name: a pid, `{atom, node}`,
`{:global, term}` or `{:via, module, term}`. Each connection resolves it with
`GenServer.whereis/1` when the guest connects, and closes at once when nothing
answers to it.

A target fixed at VM creation could only be a pid, which goes stale when the
process restarts, or one registered atom, which every VM's connections then
share. A name resolved per connection lets each VM have its own target and lets
that target restart under the same name.
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Test Results

    4 files  ±0    364 suites  ±0   5m 3s ⏱️ -39s
1 741 tests +2  1 741 ✅ +2    0 💤 ±0  0 ❌ ±0 
2 425 runs  +4  1 741 ✅ +2  684 💤 +2  0 ❌ ±0 

Results for commit d803b11. ± Comparison against base commit e281a48.

@markovejnovic
markovejnovic merged commit b5a3d58 into main Dec 2, 2026
9 checks passed
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