Download this file
| 1 | package hostedctl |
| 2 | |
| 3 | // Job states, as stored in jobs.state and shown in JobView.State. Every state |
| 4 | // the controller writes is named here; later tasks add theirs here too. |
| 5 | const ( |
| 6 | // JobWaiting: the launch intent is saved and has no VM Ref yet. Replay |
| 7 | // may launch it once its gates pass. |
| 8 | JobWaiting = "waiting" |
| 9 | // JobStarting: the provider answered the launch; the Ref is saved. |
| 10 | JobStarting = "starting" |
| 11 | // JobAbandoned: the intent was given up before any VM Ref was saved (a |
| 12 | // stop was asked for, or its stop time passed). It is never replayed |
| 13 | // again; a VM an earlier lost reply created for it is an orphan for the |
| 14 | // reaper. |
| 15 | JobAbandoned = "abandoned" |
| 16 | ) |
| 17 | |
| 18 | // Job states that mirror the VM's live state, as Stop and Refresh last read |
| 19 | // it from the provider (stop.go, refresh.go), and the one terminal state. |
| 20 | const ( |
| 21 | JobRunning = "running" |
| 22 | JobSuspending = "suspending" |
| 23 | JobSuspended = "suspended" |
| 24 | JobStopping = "stopping" |
| 25 | // JobStopped: the job carries stop proof (stop_proof_json). Nothing |
| 26 | // moves it out of this state. |
| 27 | JobStopped = "stopped" |
| 28 | ) |
| 29 | |
| 30 | // Job states of the pause barrier and resume (pause.go, resume.go). The |
| 31 | // controller sets them and settles them itself; Refresh never overwrites |
| 32 | // them, or JobSuspending set by Suspend, with the VM's live state |
| 33 | // (mirrorLive). |
| 34 | const ( |
| 35 | // JobDraining: a pause generation is open; admission is closed until |
| 36 | // the VM is suspended or Reopen confirms the runner takes work again. |
| 37 | JobDraining = "draining" |
| 38 | // JobResuming: a resume operation is prepared (resume_ops pending) and |
| 39 | // not yet committed. |
| 40 | JobResuming = "resuming" |
| 41 | ) |
| 42 | |