|
89 | 89 |
|
90 | 90 | ```
|
91 | 91 |
|
92 |
| -<details><summary>Sequence diagram of a failure with a new build coming in right away</summary> |
| 92 | +**Sequence diagram of a failure with a new build coming in right away** |
93 | 93 |
|
94 | 94 | > :warning: I see a potential conflict here. It could be that GHA1 or GHA2 causes the failure of GHA3, we might not want to accept new LeaseRequests but handle priority across remaining ones
|
95 | 95 |
|
@@ -126,69 +126,43 @@ sequenceDiagram
|
126 | 126 | GHA2->>+LeaseProvider: Aquire: priority: 2
|
127 | 127 | LeaseProvider-->>-GHA2: priority: 2, status: PENDING
|
128 | 128 |
|
129 |
| - rect rgb(200, 255,200) |
| 129 | + rect rgb(255, 200, 200) |
130 | 130 | note over GHA_NEXT: New GHA run started by GH merge queue after GHA3 failed
|
| 131 | + loop until lease successful and all request marked COMPLETED |
131 | 132 | GHA_NEXT->>+LeaseProvider: Aquire: priority:3
|
132 |
| - note right of LeaseProvider: Full state awareness |
133 |
| - LeaseProvider-->>GHA_NEXT: priority: 3, status: AQUIRED |
134 |
| - note left of GHA_NEXT: holds lease to access shared resource |
135 |
| -
|
136 |
| - GHA_NEXT->>LeaseProvider: Release: priority: 3, status: SUCCESS |
137 |
| - note right of LeaseProvider: the lease is marked as completed -> status is available on the next requests |
138 |
| - LeaseProvider-->>-GHA_NEXT: priority: 3, status: COMPLETED |
| 133 | + note right of LeaseProvider: previous lease failed |
| 134 | + LeaseProvider-->>-GHA_NEXT: error, previous lease failed (409 CONFLICT) |
| 135 | + end |
139 | 136 | end
|
140 | 137 |
|
141 |
| - GHA1->>+LeaseProvider: Aquire: priority: 1 |
142 |
| - LeaseProvider-->>-GHA1: priority: 1, status: COMPLETED |
143 |
| - GHA2->>+LeaseProvider: Aquire: priority: 2 |
144 |
| - LeaseProvider-->>-GHA2: priority: 2, status: COMPLETED |
145 |
| -``` |
146 |
| -</detail> |
147 |
| - |
148 |
| -<details><summary>Sequence Diagram of a failure and passing the lease to the next LeaseReqeust without a new contendor</summary> |
149 |
| - |
150 |
| -```mermaid |
151 |
| -sequenceDiagram |
152 |
| - participant LeaseProvider |
153 |
| - participant GHA1 |
154 |
| - participant GHA2 |
155 |
| - participant GHA3 |
156 | 138 |
|
157 |
| - |
| 139 | + par |
| 140 | + rect rgb(200, 255,200) |
| 141 | + GHA2->>+LeaseProvider: Aquire: priority: 2 |
| 142 | + note right of LeaseProvider: GHA2 has the highest priority of remaining badges |
| 143 | + LeaseProvider-->>-GHA2: priority: 2, status: AQUIRED |
| 144 | + end |
| 145 | + loop until lease successful |
158 | 146 | GHA1->>+LeaseProvider: Aquire: priority: 1
|
159 | 147 | LeaseProvider-->>-GHA1: priority: 1, status: PENDING
|
160 |
| - GHA2->>+LeaseProvider: Aquire: priority: 2 |
161 |
| - LeaseProvider-->>-GHA2: priority: 2, status: PENDING |
162 |
| -
|
163 |
| - rect rgb(255, 200, 200) |
164 |
| - GHA3->>+LeaseProvider: Aquire: priority:3 |
165 |
| - note right of LeaseProvider: Full state awareness |
166 |
| - LeaseProvider-->>GHA3: priority: 3, status: AQUIRED |
167 |
| - note left of GHA3: holds lease to access shared resource |
168 |
| -
|
169 |
| - GHA3->>LeaseProvider: Release: priority: 3, status: FAILURE |
170 |
| - note right of LeaseProvider: the lease is removed since it failed |
171 |
| - LeaseProvider-->>-GHA3: priority: 3, status: FAILURE |
172 | 148 | end
|
173 | 149 |
|
174 |
| - note right of GHA1: Assuming sufficient time has passed for stabilize window |
175 |
| -
|
176 | 150 | rect rgb(200, 255,200)
|
177 |
| -
|
178 |
| - GHA2->>+LeaseProvider: Aquire: priority: 2 |
179 |
| - note right of LeaseProvider: Full state awareness |
180 |
| - LeaseProvider-->>GHA2: priority: 2, status: AQUIRED |
181 |
| - note left of GHA2: holds lease to access shared resource |
182 |
| -
|
183 |
| - GHA2->>LeaseProvider: Release: priority: 2, status: SUCCESS |
184 |
| - note right of LeaseProvider: the lease is marked as completed -> status is available on the next requests |
| 151 | + GHA2->>+LeaseProvider: Release: priority: 2, status: SUCCESS |
| 152 | + note right of LeaseProvider: the lease is marked as completed |
185 | 153 | LeaseProvider-->>-GHA2: priority: 2, status: COMPLETED
|
186 | 154 | end
|
| 155 | + end |
187 | 156 |
|
188 | 157 | GHA1->>+LeaseProvider: Aquire: priority: 1
|
189 | 158 | LeaseProvider-->>-GHA1: priority: 1, status: COMPLETED
|
| 159 | +
|
| 160 | + GHA_NEXT->>+LeaseProvider: Aquire: priority: <> |
| 161 | + note left of GHA_NEXT: Priority is recalculated as previous branches were merged |
| 162 | + LeaseProvider-->>-GHA_NEXT: priority: <>, status: PENDING |
190 | 163 | ```
|
191 |
| -</detail> |
| 164 | + |
| 165 | + |
192 | 166 |
|
193 | 167 | ### GithubAction
|
194 | 168 | > :warning: WIP
|
|
0 commit comments