Skip to content

fix(azure): emit the bake marker before deprovision, and never wait on it - #243

Merged
ruby-dlee merged 1 commit into
mainfrom
fm/bake-marker-before-deprovision
Aug 18, 2026
Merged

fix(azure): emit the bake marker before deprovision, and never wait on it#243
ruby-dlee merged 1 commit into
mainfrom
fm/bake-marker-before-deprovision

Conversation

@ruby-dlee

Copy link
Copy Markdown
Owner

A bake that installed everything correctly still hung for 90 minutes and captured nothing.

The guest script ran waagent -deprovision+user -force and then echoed its completion marker. Deprovisioning stops the guest agent, and the guest agent is what carries a run command output back to the caller. The marker could never be delivered, so the invoking CLI blocked until Azure extension timeout no matter how well the bake went.

This could never have worked. It stayed hidden because an earlier bug killed the guest script on its first line, and a script that dies instantly never reaches deprovision. Fixing that one exposed this one.

Fix

The guest script ends at its marker and does not deprovision at all. The host deprovisions afterwards as its own fire-and-forget call, since a call that stops the agent can never report its own completion, and Azure still requires it before generalize.

Verification

tests/fm-azure-cell-image.test.sh exits 0. The new case reads the generated guest script and fails if deprovision appears in it, and requires the host deprovision to be --no-wait and to precede generalize.

mutation (verified applied) result
deprovision put back in the guest script red
host waits on the deprovision call red

Related

The image this bake was meant to produce has since been captured from the built builder and verified to carry pi 0.84.1, node, and the pinned closures.

…n it

A bake that installed everything correctly still hung for 90 minutes and
captured nothing. The guest script ran `waagent -deprovision+user -force` and
then echoed its completion marker, but deprovisioning stops the guest agent, and
the guest agent is what carries a run command's output back to the caller. The
marker could never be delivered, so the invoking CLI blocked until Azure's
extension timeout no matter how well the bake went.

This could never have worked. It stayed hidden because an earlier bug killed the
guest script on its first line, and a script that dies instantly never reaches
deprovision. Fixing that one exposed this one.

The guest script now ends at its marker and does not deprovision at all. The
host deprovisions afterwards as its own fire-and-forget call, since a call that
stops the agent can never report its own completion, and Azure still requires it
before generalize.

Verification: tests/fm-azure-cell-image.test.sh exits 0, with a case that reads
the GENERATED guest script and fails if deprovision appears in it, and that
requires the host's deprovision to be --no-wait and to precede generalize. Two
mutations, each red: deprovision put back in the guest script, and the host
waiting on the deprovision call.

The image this bake was meant to produce has since been captured from the built
builder and verified to carry pi 0.84.1, node, and the pinned closures.
@ruby-dlee
ruby-dlee merged commit ffb869c into main Aug 18, 2026
13 checks passed
@ruby-dlee
ruby-dlee deleted the fm/bake-marker-before-deprovision branch August 18, 2026 14:43
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