fix: Stop a rolled-back replica gracefully #102
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/blocked
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions!102
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/101-graceful-rollback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue
Closes #101
Problem
On rollback, the new replica that never turned healthy is removed with
docker rm -f: SIGKILL, no grace. It still runs its background work, so rihla's startup welcome pass can be killed mid-send, and those claims are lost for good. Seen live in rihla run 891 (suhba/rihla#417); nothing was being sent that time.Solution
Stop the new replicas with plain
docker stop(their own stop signal andstop_grace_period), then remove them. This is the same treatment the old replicas get on a successful swap.Review notes
The rollback behaviour case now asserts
docker stop new1anddocker rm new1; it fails against main'srm -f.Risks and trade-offs
A rollback now takes as long as the failed replica needs to stop. The old replicas keep serving throughout.
Verified:
docker stop(no-t, so each container's own stop signal andstop_grace_periodapply) and thendocker rmon the new replicas; the old replicas are not touched and the step still exits 1. Both #101 criteria hold.docker rm -fin place of the two lines, "unhealthy new replica: rolled back, the old one keeps serving" fails and nothing else changes, so the case pins the fix.PR / validategreen.Noted, not a finding: a replica that ignores SIGTERM holds the failed deploy for its full grace period before the step reports; the PR states the trade-off and the old replicas serve throughout.
APPROVED.