Repository navigation
Recover bounded golden route migrations - #160
Conversation
📝 WalkthroughWalkthroughThe migration acceptance window increased from two to five minutes, and destination-proof retries increased from 16 to 64. Unix process termination now falls back to individual signaling only when group signaling fails, with graceful cleanup coverage. ChangesMigration timing and proof limits
Unix process termination
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go`:
- Around line 102-104: Bound the cleanup wait after
terminateProcessGroup(command) so command.Wait() cannot block indefinitely. Wait
for the command to exit with a timeout, invoke killProcessGroup(command) when
the timeout expires, then fail the test; preserve the existing graceful-exit
failure handling for commands that return an error.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ada62be6-dae1-4bcf-8261-92b7f57d0997
📒 Files selected for processing (9)
cmd/subrouter-transport-observer/golden.gocmd/subrouter-transport-observer/golden_acceptance_regression_test.gocmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.gocmd/subrouter-transport-observer/golden_migration_transition.gocmd/subrouter-transport-observer/golden_process_unix.gocmd/subrouter/deploy_scripts_test.godeploy/gcp/deployment-contract.pydeploy/gcp/switch-front-migration.shdeploy/gcp/validate-deploy-evidence.py
| terminateProcessGroup(command) | ||
| if err := command.Wait(); err != nil { | ||
| t.Fatalf("cleanup helper did not exit gracefully: %v", err) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate and inspect the referenced test and helper.
fd -a 'golden_deployment_action_lifecycle_unix_test.go' . || true
file="$(fd 'golden_deployment_action_lifecycle_unix_test.go' . | head -n 1)"
if [ -z "${file:-}" ]; then
echo "Referenced file not found"
exit 0
fi
echo "== file =="
echo "$file"
echo "== outline =="
ast-grep outline "$file" || true
echo "== relevant lines =="
nl -ba "$file" | sed -n '1,150p'
echo "== terminateProcessGroup usages =="
rg -n "terminateProcessGroup|Wait\\(|signal\\(|kill\\(" "$file" .Repository: manaflow-ai/subrouter
Length of output: 938
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="./cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go"
echo "== relevant lines 1-220 =="
awk '{printf "%6d\t%s\n", NR, $0}' "$file" | sed -n '1,220p'
echo "== helper function definitions and usages =="
awk '{printf "%6d\t%s\n", NR, $0}' "$file" | grep -nE 'func terminateProcessGroup|terminateProcessGroup\\(|\\.Wait\\(|\\.Start\\(|\\.StartProcess|process\\.|signal\\(|syscall\\.|Cleanup\\('
echo "== go files in package =="
find cmd/subrouter-transport-observer -maxdepth 2 -type f -name '*.go' -print | sortRepository: manaflow-ai/subrouter
Length of output: 7284
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="./cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go"
awk '
/^func (configure|kill|terminate)ProcessGroup/ {p=1}
p {print sprintf("%6d\t%s", NR, $0)}
p && /^[}]$/{p=0}
' "$file"
echo "== process helper calls =="
awk '{printf "%6d\t%s\n", NR, $0}' "$file" | grep -nE 'configureProcessGroup|killProcessGroup|terminateProcessGroup|command\\.Wait\\(|\\.Start\\('
echo "== files with process helpers =="
rg -n "func (configure|kill|terminate)ProcessGroup|configureProcessGroup|killProcessGroup|terminateProcessGroup|Wait\\(" cmd/subrouter-transport-observer -g '*.go'Repository: manaflow-ai/subrouter
Length of output: 210
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="./cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go"
echo "== process helper slices =="
python3 - <<'PY'
from pathlib import Path
import re
p=Path("cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go")
text=p.read_text()
for name in ["configureProcessGroup","killProcessGroup","terminateProcessGroup"]:
print(f"\n== func {name} ==")
m=re.search(rf"(?ms)^func {name}\b.*?\n\}}", text)
print(m.group(0) if m else "not found")
PY
echo "== relevant calls =="
python3 - <<'PY'
import re
from pathlib import Path
p=Path("cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go")
lines=p.read_text().splitlines()
for i,l in enumerate(lines,1):
if any(s in l for s in ["configureProcessGroup","killProcessGroup","terminateProcessGroup","command.Wait",".Wait"]):
print(f"{i}: {l}")
PYRepository: manaflow-ai/subrouter
Length of output: 510
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== all process group symbols =="
rg -n "processGroup|ProcessGroup|TerminateProcessGroup|killProcessGroup|configureProcessGroup" . -g '*.go'
echo "== git status/stat =="
git diff --stat || true
git status --short || trueRepository: manaflow-ai/subrouter
Length of output: 3481
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== process helper definitions =="
awk '
/^func (configureProcessGroup|interruptProcessGroup|terminateProcessgroup|killProcessGroup|terminateProcessGroup)\b/ {p=1}
p {print sprintf("%6d\t%s", NR, $0)}
p && /^[^{]*\}/ && NR>begin {p=0}
{if (/^func /) begin=NR}
' cmd/subrouter-transport-observer/golden_process_unix.go cmd/subrouter-transport-observer/golden.go | sed -n '1,120p'
echo "== golden process_unix.go =="
cat -n cmd/subrouter-transport-observer/golden_process_unix.go
echo "== related waits in golden_process_unix.go candidates =="
rg -n "\bWait\(|killProcessGroup|terminateProcessGroup" cmd/subrouter-transport-observer/golden_process_unix.go cmd/subrouter-transport-observer/golden.goRepository: manaflow-ai/subrouter
Length of output: 2213
Bound the process wait.
terminateProcessGroup(command) tries SIGTERM once, then falls back once. If both attempts fail, command.Wait() at Cmd.Wait() can block indefinitely and prevent the t.Cleanup at killProcessGroup(command) + command.Wait() from running. Wait with a timeout; kill the helper with killProcessGroup(command) if it does not exit; then fail the test.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@cmd/subrouter-transport-observer/golden_deployment_action_lifecycle_unix_test.go`
around lines 102 - 104, Bound the cleanup wait after
terminateProcessGroup(command) so command.Wait() cannot block indefinitely. Wait
for the command to exit with a timeout, invoke killProcessGroup(command) when
the timeout expires, then fail the test; preserve the existing graceful-exit
failure handling for commands that return an error.
The staging golden run reached its two-minute route-proof limit while existing Codex streams remained healthy. Google Cloud documents URL-map propagation as taking several minutes. Cleanup then received duplicate SIGTERM delivery and was interrupted before restoring the URL map and releasing the deploy lock.
This keeps migration proof bounded at five minutes, raises the correlated proof-attempt ceiling to use that window, and makes direct process signaling a fallback when process-group signaling fails.
Regression sequence:
Verified:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Extend the golden-route migration propagation window to 5 minutes and harden cleanup, preventing stuck deploys when URL-map propagation is slow or SIGTERM delivery is flaky.
deploy/gcp/deployment-contract.py,deploy/gcp/validate-deploy-evidence.py, anddeploy/gcp/switch-front-migration.sh.Written for commit fddbe82. Summary will update on new commits.
Summary by CodeRabbit
Improvements
Tests