Files
Pulse/internal/agentexec
rcourtman 38694f293e Let two machines with one hostname each hold a command session
Two Proxmox installations that reuse a node name or a VM name could not
both hold a command channel. The command server admitted one session per
hostname per tenant, so the second agent was refused on every retry and its
actions read "not connected". After a Pulse restart, whichever agent came
back first won, which dropped the other node's LXC Docker containers.

That rule came from c41edb65a0. Before it, a hostname lookup took the first
map match, so two same-named sessions meant a random machine. The rule fixed
the tie but not the cause. A hostname still does not name a machine: the
first token to connect held the name and locked the real machine out, and a
lone holder answered for a same-named machine that was offline.

Sessions are now keyed by tenant and agent ID alone. One agent ID from two
hostnames stays refused. The server has no lookup by hostname any more, and
each route that picked a session by name now asks by identity:

- Proxmox guest actions and Patrol probes start from the guest's own record.
  A typed lifecycle action carries only a VMID, so a runner chosen by node
  name could have changed another machine's guest with the same VMID.
- The legacy Assistant route and its cluster peer lookup took whichever agent
  a hostname map held last, and now refuse a tie.
- The connections ledger no longer falls back to the hostname, so a machine
  with no session stops reading as connected through its namesake's.
- A name lookup never reads an agent ID as a name, since a token holder picks
  its own first ID.

A proven node agent with no session yet now dispatches nothing instead of
counting as a node failure. Those failures opened the node breaker while
agents reconnected after a restart, and the node's LXC containers then left
the Docker page for the backoff window.

Refs #2681
2026-11-05 22:11:32 +00:00
..
2026-03-18 16:06:30 +00:00
2026-10-11 22:20:25 +01:00