Skip to content

fix: remove the canary when activation confirmation fails - #415

Open
FlorianFranzen wants to merge 1 commit into
serokell:masterfrom
FlorianFranzen:fix/stale-canary
Open

FlorianFranzen wants to merge 1 commit into
serokell:masterfrom
FlorianFranzen:fix/stale-canary

Conversation

@FlorianFranzen

@FlorianFranzen FlorianFranzen commented Nov 3, 2026 •

Copy link
Copy Markdown

What changed

  • activation_confirmation removes the canary when the confirmation fails, after dropping its watcher.
  • Add a regression test: a timed out confirmation leaves no canary behind.

Why

On a timeout, activate rolled back but left deploy-rs-canary-<hash> in temp_path. wait returns at once when that file already exists, so on the next deployment of the same closure the deployer confirmed by deleting the stale canary while activation was still running. The canary created after activation was then never removed, so the host timed out and rolled back, while deploy reported success, and left a canary again. Once one confirmation had timed out, every retry of the same closure rolled back until the file was removed by hand.

This may explain #214, where Deployment confirmed. is printed before activation finishes.

Validation

  • cargo test --all-targets (the new test fails without the fix)
  • cargo clippy --all-targets -- --deny warnings
  • cargo fmt --check

When the confirmation times out, `activate` rolls back but leaves the
canary in `temp_path`. The next `wait` for the same closure finds it at
once, the deployer confirms by deleting it before activation is done
and reports success, and the new canary is never removed: the host
rolls back again.

Remove the canary whenever the confirmation fails, after dropping the
watcher so its removal is not reported as an event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant