Skip to content

machine.Start() context cancellation ignores clean exit #200

@thepwagner

Description

@thepwagner

Since #182 , I'm seeing a red herring message logged at "level=error" by the SDK:

time="2020-02-19T13:06:51Z" level=info msg="VMM logging and metrics disabled."
time="2020-02-19T13:06:51Z" level=info msg="refreshMachineConfiguration: [GET /machine-config][200] getMachineConfigurationOK  &{CPUTemplate:T2 HtEnabled:0xc00f367494 MemSizeMib:0xc00f367488 VcpuCount:0xc00f367480}"
[... boring boot logs]
time="2020-02-19T13:06:51Z" level=info msg="startInstance successful: [PUT /actions][204] createSyncActionNoContent " 
[... machine completes, signals restart to terminate VM]
time="2020-02-19T13:07:03Z" level=info msg="firecracker exited: status=0"
time="2020-02-19T13:07:03Z" level=error msg="failed to stop vm \"35bd7d10-99f1-4f47-99ff-903efeee8d03\"" error="os: process already finished"

I'm nesting all firecracker operations behind a ctx, cancel := context.WithTimeout(...); defer cancel().
That deferred cancellation happens after the VM has completed.

I'd like to patch this by string matching against the returned err from Signal() inside stopVMM(), like containerd does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions