Skip to content

A placement call lost mid-flight can leave a running, admitted VM whose id the caller never got #213

Backlog

Description

@markovejnovic

Found by model checking (the Quint specs in #206). A counterexample in the model, each step read in the code at e281a48. Not reproduced on a running system.

  • Where: lib/hyper/cluster/scheduler.ex:53-59 and 99-103, lib/hyper.ex:25-40.
  • Chain:
    1. create_vm/1 generates the vm_id and the scheduler calls try_run/3 on a node over :erpc.
    2. The call is lost after it was sent. The scheduler returns {:error, :node_unreachable} and tries no other node.
    3. The node boots the VM and admits it anyway.
  • Effect: a VM runs and holds budget, and the caller got an error that does not carry the id create_vm/1 generated.
  • Not retrying is right: the log line at scheduler.ex:54-57 says the node may have booted the VM, and in the model a retry (placement_retrying) places the request twice.
  • Model: placement_lossy violates unreachableLeavesNothingAdmitted. The trace, from spec/ on that branch after npm ci:
    node_modules/.bin/quint run placement.qnt --main placement_lossy \
      --invariant unreachableLeavesNothingAdmitted --max-samples 100000 --max-steps 40
  • Repro: not written. Drop the distribution connection to the target node while try_run/3 is booting.
  • Fix: return the id with the error, so the caller can look the VM up or stop it. Or have the node stop a VM whose placing call can no longer be answered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Fields

    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions