You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c10f3d1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(relay): apply tunnel cleanup mode without a forced deploy
The cleanup mode was read through Config in the Worker's Init, which Alchemy
does not compare when deciding whether the Worker changed
(alchemy-run/alchemy#1831). Changing it needed a forced deploy, and a forced
deploy replaces the Postgres runtime role (alchemy-run/alchemy#1832).
Declare the mode as a plain Worker env binding, which Alchemy diffs, and read
it from the Worker env at runtime. Default the manual deploy's force input to
off and document when force is still needed.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The relay Worker reads these variables and secrets when it is deployed. Alchemy does not redeploy the
144
-
Worker when only one of these values changes ([alchemy-run/alchemy#1831](https://github.com/alchemy-run/alchemy/issues/1831)),
145
-
so a push to `main` without relay code changes leaves the old value in place. After changing one, run
146
-
the **Deploy T3 Connect relay** workflow manually from `main` with **force** checked.
143
+
After changing a variable or secret, run the **Deploy T3 Connect relay** workflow manually from
144
+
`main`. The tunnel cleanup modes are Worker `env` bindings, so a normal run applies them. Alchemy does
145
+
not redeploy the Worker when only a value read in the Worker's startup code changes
146
+
([alchemy-run/alchemy#1831](https://github.com/alchemy-run/alchemy/issues/1831)), so any other
147
+
variable or secret needs the run with **force** checked. A forced run also replaces the Postgres
148
+
runtime role and its password ([alchemy-run/alchemy#1832](https://github.com/alchemy-run/alchemy/issues/1832)).
147
149
148
150
The account-scoped repository credentials are consumed by Alchemy while provisioning relay stages; they
149
151
are not bound into the relay Worker. The production deployment uses an Axiom personal access token,
@@ -168,7 +170,7 @@ because those builds register recovery and replace a deleted tunnel after wake.
168
170
1. Deploy the relay and migration with cleanup `off`.
169
171
2. Release the server build and confirm current hosts register recovery. Older hosts stay marked
170
172
legacy and are never candidates.
171
-
3. Set `dry-run`, run a forced relay deploy, and read the sweep counters (`scanned`, `wouldDelete`,
173
+
3. Set `dry-run`, run a relay deploy, and read the sweep counters (`scanned`, `wouldDelete`,
172
174
`skippedLegacy`, `skippedOrphan`, `failed`, `truncated`) across several sweeps. Each sweep records
173
175
them, and the active `mode`, as `relay.managed_endpoint_reaper.*` attributes on its
174
176
`relay.managed_endpoint_reaper.sweep` span in Axiom.
@@ -178,10 +180,10 @@ because those builds register recovery and replace a deleted tunnel after wake.
178
180
The job runs every five minutes with a five-minute grace period for tunnels that lost their
179
181
connector, so a candidate is usually removed five to ten minutes after it goes down. Tunnels that
180
182
never connected wait an hour. One sweep attempts at most 100 deletions, so a backlog takes longer.
181
-
Changing `RELAY_TUNNEL_CLEANUP_MODE`, including turning cleanup off during an incident, needs a forced
182
-
relay deploy. Confirm the new `mode` on the next sweep span.
183
+
Changing `RELAY_TUNNEL_CLEANUP_MODE`, including turning cleanup off during an incident, needs a relay
184
+
deploy without force. Confirm the new `mode` on the next sweep span.
183
185
184
-
To roll back, set cleanup to `off` and run a forced relay deploy before downgrading any host. Keep the
186
+
To roll back, set cleanup to `off` and run a relay deploy before downgrading any host. Keep the
185
187
recovery endpoints deployed while current server builds are in use. The nullable columns can stay.
186
188
187
189
### Disposable-host canary
@@ -201,8 +203,8 @@ stage, test Cloudflare account, disposable host, and disposable T3 home. Keep pr
201
203
and pause it with `kill -STOP <first-pid>`. Wait until Cloudflare reports it down for over five
202
204
minutes.
203
205
5. Confirm dry-run counts the first tunnel in `wouldDelete` and the second in `skippedLegacy`.
204
-
6. Set cleanup `enabled` on the disposable stage and deploy it with `--force`. Confirm in the test
205
-
Cloudflare account that the first tunnel is deleted and the legacy tunnel still exists.
206
+
6. Set cleanup `enabled` on the disposable stage and deploy. Confirm in the test Cloudflare account
207
+
that the first tunnel is deleted and the legacy tunnel still exists.
206
208
7. Resume the first child with `kill -CONT <first-pid>`. Confirm the running server detects the
207
209
repeated rejection, requests recovery, and becomes reachable at the same hostname without a
0 commit comments