transport: derive the daemon endpoint from the uid, not from a variable #281
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!281
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-275"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #275.
Reworked to plan v3 (issue #275 comment 2818), which replaces the rev-12 relay-probe design this branch
carried before.
What changes
The endpoint is a function of the uid first, the environment second.
SocketPath::resolve(uid)infelis-transport is the single derivation, shared by
serve, local clients and the relay:$XDG_RUNTIME_DIR/feliswhen set and non-empty →/run/user/<uid>/feliswhen it exists, is a non-symlink directory owned by the uid and is mode exactly0700→${TMPDIR:-/tmp}/felis.<uid>$TMPDIR/felis.<uid>when set and non-empty →<confstr(_CS_DARWIN_USER_TEMP_DIR)>/felis.<uid>→/tmp/felis.<uid>A
/run/user/<uid>that exists but fails validation is a hard resolution error naming the reason and therecovery, never a fall-through: falling back to
/tmpis exactly the split this change removes. An emptyTMPDIR/XDG_RUNTIME_DIRnormalizes to unset; a relativeXDG_RUNTIME_DIRis treated as unset and warnedabout once per process.
A raw connect error is classified before anything spawns. Only
io::ErrorKind::NotFound | ConnectionRefusedlicenses a spawn. The same rule applies on the local dial, in
connect_or_spawn_daemon's fork path, in thesystemd hand-off, and in the relay; post-connect failures keep spawn-and-retry.
The relay goes back to a single endpoint.
felis-daemon relayresolves the same endpoint every otherprocess does and stays on it: no endpoint topology, no sibling selection, no probing another endpoint to decide
where to spawn.
Doctor reports what another environment on this host could reach. A
daemon-siblingrow is emitted persibling candidate that answers, with the target/default/sibling provenance rules of the plan's Decision 3, plus a
bounded dial (
dial_bounded) that names which phase a deadline caught.Out of scope
Daemon lifetime after endpoint loss (a daemon whose runtime directory logind removed at last logout) is not
addressed here. Issue #282 owns it: no watch/drain, no
Listener::dropchange, no agent-link change, nostale-stamp recovery is in this branch. The how-to and CHANGELOG tell hosts that serve persistent daemons to
loginctl enable-linger, which is the operational answer until #282 lands.Gates
just checkandjust check-windowspass locally.ae85a1c6baba17042c83daemon: probe the login manager's endpoint before a relay autospawns (#275)to transport: derive the daemon endpoint from the uid, not from a variableba17042c83a772dd17d4a772dd17d48bcc200614