Skip to content

Commit

Permalink
ci: fix gofmt on tasklifecycle (#14232)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 authored Aug 23, 2022
1 parent e4e445e commit dc1c50e
Showing 1 changed file with 54 additions and 55 deletions.
109 changes: 54 additions & 55 deletions client/allocrunner/tasklifecycle/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,67 +25,66 @@ Close() methods of the Gates.
In this state, the Coordinator is allowing prestart tasks to run, while
blocking the main tasks.
┌────────┐
│ ALLOC │
│ RUNNER │
└───┬────┘
Task state
┌────────────▼────────────┐
│Current state: │
│Prestart │ ┌─────────────┐
│ │ │ TASK RUNNER │
│ ┌───────────────────┼─────────┤ (Prestart) │
│ │ │ └─────────────┘
│ │ │
│ │ │ ┌─────────────┐
│ │ COORDINATOR │ │ TASK RUNNER │
│ │ ┌─ ─ ─┼─ ─ ─ ─┬╶┤ (Main) │
│ │ ╷ │ ╷ └─────────────┘
│ │ ╷ │ ╷
│ │ ╷ │ ╷ ┌─────────────┐
│ Prestart Main │ ╷ │ TASK RUNNER │
└─────┬─┬───────────┬─┬───┘ └╶┤ (Main) │
│ │Open/ ╷ │Open/ └─────────────┘
│ │Close ╷ │Close
┌──┴─▼─┐ ┌──┴─▼─┐
│ GATE │ │ GATE │
└──────┘ └──────┘
┌────────┐
│ ALLOC │
│ RUNNER │
└───┬────┘
Task state
┌────────────▼────────────┐
│Current state: │
│Prestart │ ┌─────────────┐
│ │ │ TASK RUNNER │
│ ┌───────────────────┼─────────┤ (Prestart) │
│ │ │ └─────────────┘
│ │ │
│ │ │ ┌─────────────┐
│ │ COORDINATOR │ │ TASK RUNNER │
│ │ ┌─ ─ ─┼─ ─ ─ ─┬╶┤ (Main) │
│ │ ╷ │ ╷ └─────────────┘
│ │ ╷ │ ╷
│ │ ╷ │ ╷ ┌─────────────┐
│ Prestart Main │ ╷ │ TASK RUNNER │
└─────┬─┬───────────┬─┬───┘ └╶┤ (Main) │
│ │Open/ ╷ │Open/ └─────────────┘
│ │Close ╷ │Close
┌──┴─▼─┐ ┌──┴─▼─┐
│ GATE │ │ GATE │
└──────┘ └──────┘
When the prestart task completes, the allocRunner will send a new batch of task
states to the Coordinator that will cause it to transition to a state where it
will close the Gate for prestart tasks, blocking their execution, and will open
the Gate for main tasks, allowing them to start.
┌────────┐
│ ALLOC │
│ RUNNER │
└───┬────┘
Task state
┌────────────▼────────────┐
│Current state: │
│Main │ ┌─────────────┐
│ │ │ TASK RUNNER │
│ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┼─ ─ ─ ─ ─┤ (Prestart) │
│ ╷ │ └─────────────┘
│ ╷ │
│ ╷ │ ┌─────────────┐
│ ╷ COORDINATOR │ │ TASK RUNNER │
│ ╷ ┌─────┼───────┬─┤ (Main) │
│ ╷ │ │ │ └─────────────┘
│ ╷ │ │ │
│ ╷ │ │ │ ┌─────────────┐
│ Prestart Main │ │ │ TASK RUNNER │
└─────┼─┬───────────┬─┬───┘ └─┤ (Main) │
╷ │Open/ │ │Open/ └─────────────┘
╷ │Close │ │Close
┌──┴─▼─┐ ┌──┴─▼─┐
│ GATE │ │ GATE │
└──────┘ └──────┘
┌────────┐
│ ALLOC │
│ RUNNER │
└───┬────┘
Task state
┌────────────▼────────────┐
│Current state: │
│Main │ ┌─────────────┐
│ │ │ TASK RUNNER │
│ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┼─ ─ ─ ─ ─┤ (Prestart) │
│ ╷ │ └─────────────┘
│ ╷ │
│ ╷ │ ┌─────────────┐
│ ╷ COORDINATOR │ │ TASK RUNNER │
│ ╷ ┌─────┼───────┬─┤ (Main) │
│ ╷ │ │ │ └─────────────┘
│ ╷ │ │ │
│ ╷ │ │ │ ┌─────────────┐
│ Prestart Main │ │ │ TASK RUNNER │
└─────┼─┬───────────┬─┬───┘ └─┤ (Main) │
╷ │Open/ │ │Open/ └─────────────┘
╷ │Close │ │Close
┌──┴─▼─┐ ┌──┴─▼─┐
│ GATE │ │ GATE │
└──────┘ └──────┘
Diagram source:
https://asciiflow.com/#/share/eJyrVspLzE1VssorzcnRUcpJrEwtUrJSqo5RqohRsjI0MDTViVGqBDKNLA2ArJLUihIgJ0ZJAQYeTdmDB8XE5CGrVHD08fF3BjPRZYJC%2Ffxcg7DIEGk6VDWyUEhicbZCcUliSSp2hfgNR6BpxCmDmelcWlSUmlcCsdkKm62%2BiZmo7kEOCOK8jtVmrGZiMVchxDHYGzXEYSpIspVUpKAREOQaHOIYFKKpgGkvjcIDp8kk2t7zaEoDcWgCmsnO%2Fv5BLp5%2BjiH%2BQVhNbkKLjyY8LtNFAyDdCgoavo6efppQ0%2FDorkETrQGypxDtrxmkmEyiK8iJ24CiVGAeKyqBGgPNVWjmYk%2FrVE7X8LhBiwtEcQRSBcT%2B%2Bs4KyK5D4pOewlFMRglfuDy6vmkoLoaL1yDLwXUquDuGuCogq4aLYDd9CnbT0V2uVKtUCwCqNQgp)
Expand Down

0 comments on commit dc1c50e

Please sign in to comment.