| β¦ | β¦ | @@ -0,0 +1,1198 @@ | |
| 969 | + | const taken = new Set(state.envs.map((env) => env.port).concat(state.feedPort)); | |
| 970 | + | ||
| 971 | + | if (!isLabProcess(state.feedPid, "__feed")) { | |
| 972 | + | state.feedPort = await freePort("127.0.0.1", taken); | |
π‘ Medium scripts/update-lab.ts:972
When the feed process dies, rerunning up can move the feed to a new port while leaving live servers running with npm_config_registry and T3CODE_RELEASE_BASE_URL still pointing to the old port; provider discovery and self-update then cannot reach the feed. Reuse the previous port when it is free, or restart the servers when the feed origin changes.
No longer relevant as of 4ff07873e093952aa6c59a374dfaf088c0d690b1
Note
Written by gpt-6.1-sol on behalf of Maria
The lab now reuses the dead feed's free port. If another listener occupies it, only the recorded lab servers restart with the new feed origin. Both cases were exercised: the first preserved all three server PIDs, and the second preserved the unrelated listener while all three environments discovered provider updates on the new origin.
| β¦ | β¦ | @@ -0,0 +1,1198 @@ | |
| 198 | + | NodeFS.renameSync(temp, STATE_PATH); | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | function updateState(mutate: (state: LabState) => void): LabState { | |
π‘ Medium scripts/update-lab.ts:201
Concurrent state updates can silently discard a successful install: two updateState calls can read the same state.json, then the later rename overwrites the earlier install's version. down can also write its stale snapshot after an installer finishes. Serialize cross-process mutations and avoid writing stale state snapshots.
No longer relevant as of 4ff07873e093952aa6c59a374dfaf088c0d690b1
Note
Written by gpt-6.1-sol on behalf of Maria
State mutation now holds a kernel flock through read, mutation and rename. Lifecycle commands have their own lock and write fresh process fields, preserving concurrent installer writes. Concurrent Grok and Pi installs across all three environments persisted their successful versions.