deploy: Finish activations whose connection drops
Activation runs in a transient unit, but its output still went straight back over the connection, and `activate-rs` panics when a write fails. Deploying `palace` and `slop-cannon` together stopped the broker, which dropped the connection to `slop-cannon` and left its switch half done. The output now goes through a `cat` that gives way to one discarding it once the connection is gone. Switching also no longer restarts the broker, so it can deploy its own box and report the result; a new version or configuration takes effect at the next restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #3.
This commit is contained in:
1 parent
2df7cd3dee
commit
ebf22a932d
4 files changed
+52
-5
No files matched your search
+8
-3
@@ -211,7 +211,8 @@ own fields. The module and the broker refuse any other operation or field.
|
||||
a typical use.
|
||||
- **Limits.** `auto` operations are rate-limited per requester, so a looping agent can't hammer
|
||||
boxes or APIs. Pending requests are capped per requester and overall to limit notification spam.
|
||||
- **Restarts** drop pending requests and leases.
|
||||
- **Restarts** drop pending requests and leases. Deploying the broker's box doesn't restart it;
|
||||
restart `slop-broker.service` for a new version or configuration to take effect.
|
||||
|
||||
### Approvals web app
|
||||
|
||||
@@ -393,8 +394,12 @@ broker runs it over SSH.
|
||||
6. **Activate.** On every node at once, the broker runs deploy-rs's `activate-rs` on each profile in
|
||||
deploy-rs's order.
|
||||
- It runs as root through the target's `sudo` command (`sudo -u` by default), inside a
|
||||
transient unit (`systemd-run`), so the activation finishes even if the connection drops,
|
||||
including when the broker deploys its own box and restarts.
|
||||
transient unit (`systemd-run`), so the activation finishes even if the connection drops.
|
||||
Its output streams back until then and is discarded after, since `activate-rs` stops when
|
||||
it can't write.
|
||||
- Switching doesn't restart the broker (`restartIfChanged = false`), so it can deploy its own
|
||||
box and report the result. A new version or configuration of the broker takes effect when
|
||||
it's next restarted.
|
||||
- Output comes back prefixed with the node.
|
||||
- Deploys run in parallel; an agent that needs an order sends separate requests.
|
||||
|
||||
|
||||
Reference in new issue
Block a user