Native single-instance and control-socket rpc.eval - #14
Merged
dominicletz merged 6 commits intoSep 13, 2026
Merged
Conversation
Add the single-instance spec and rewrite --edw-rpc off erl_call. The control socket stays separate from the Elixir EDW TCP client. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Bind a per-user lock when instances=single. Second launch sends instance.activate. --edw-rpc is a control-socket client that forwards rpc.eval to the connected Elixir Transport. Drop erl_call. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Linux Elixir E2E covers instance.activate and --edw-rpc. Shared suite is the source of truth for all hosts. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
dominicletz
marked this pull request as ready for review
September 11, 2026 14:39
on_exit Process.exit/2 on a dead drain pid can hit the next ExUnit test after pid reuse. Only kill the drain while it still owns the port. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Close the port and terminate the host OS pid. Do not kill a stored drain pid. Unlink Transport from the E2E test process. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Copy the remaining byte count before withUnsafeMutableBytes so the exclusive buffer access does not overlap buf.count. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The host now owns single-instance locking and
--edw-rpcno longer useserl_callor epmd.When
instances = single, the first host binds a per-user control socket (Unix socket on macOS/Linux, mutex + named pipe on Windows). A second launch sendsinstance.activatewith the forwarded argv, the running host raises windows and emitsevent.system.open_url/open_file/reopen, and the second process exits 0.--edw-rpcis a control-socket client. It sendsinstance.eval; the host forwardsrpc.evalto the connected ElixirTransport, which runsCode.eval_string/1and returnsKernel.inspect/1. The EDW TCP session stays one Elixir client.Default
instances = multiso current E2E and--edw-no-beamkeep working. Packaged apps setsinglein their ini. On BEAM spawn the host setsRELEASE_DISTRIBUTION=nonewhen that env key is unset.Specs
docs/specs/feature-single-instance.mdandtests-single-instance.yamlfeature-edw-rpc.md/tests-edw-rpc.yaml(drop cookie / node /erl_call)Tests
Linux Elixir E2E is green:
test/e2e/rpc_test.exs:1+1→2; module eval; no host → non-zero;--edw-rpc+--edw-recoverexclusivetest/e2e/instance_test.exs: second hostddrive://invite/x→event.system.open_url; empty argv → reopen;instances=multiboth stay upmix test --exclude host: 33 tests, 0 failuresLauncher.stop/1stopped usingProcess.exit/2on a stored drain pid (that kill could hit a reused ExUnit test pid)Status rows for
--edw-rpc(control socket) and Single-instance aredoneon macOS, Windows, and Linux. Shared Elixir E2E is the source of truth.Out of scope
vm.args--edw-recoverchanges