Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: common/api/dm/service/v1/attempt_state_evolve.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fix imports and make dummy.go a real file Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/api/dm/service/v1/attempt_data.go ('k') | common/api/dm/service/v1/attempt_state_evolve_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/api/dm/service/v1/attempt_state_evolve.go
diff --git a/common/api/dm/service/v1/attempt_state_evolve.go b/common/api/dm/service/v1/attempt_state_evolve.go
index 3a7642c7926bafdbb30f356e9d080b513ee071e9..451347be297611b731b7c1ff6444faad4cad3689 100644
--- a/common/api/dm/service/v1/attempt_state_evolve.go
+++ b/common/api/dm/service/v1/attempt_state_evolve.go
@@ -12,12 +12,23 @@ import (
// transitions. The identity transition (X -> X) is implied, as long as X has an
// entry in this mapping.
var validAttemptStateEvolution = map[Attempt_State][]Attempt_State{
- Attempt_ADDING_DEPS: {Attempt_BLOCKED, Attempt_NEEDS_EXECUTION},
- Attempt_BLOCKED: {Attempt_AWAITING_EXECUTION_STATE, Attempt_NEEDS_EXECUTION},
- Attempt_AWAITING_EXECUTION_STATE: {Attempt_NEEDS_EXECUTION},
- Attempt_EXECUTING: {Attempt_ADDING_DEPS, Attempt_FINISHED},
- Attempt_FINISHED: {},
- Attempt_NEEDS_EXECUTION: {Attempt_EXECUTING},
+ Attempt_SCHEDULING: {
+ Attempt_EXECUTING, // scheduled
+ Attempt_ABNORMAL_FINISHED, // cancelled/timeout/err/etc.
+ },
+ Attempt_EXECUTING: {
+ Attempt_SCHEDULING, // Retry
+ Attempt_WAITING, // EnsureGraphData
+ Attempt_FINISHED, // FinishAttempt
+ Attempt_ABNORMAL_FINISHED, // cancel/timeout/err/etc.
+ },
+ Attempt_WAITING: {
+ Attempt_SCHEDULING, // unblocked
+ Attempt_ABNORMAL_FINISHED, // cancelled
+ },
+
+ Attempt_FINISHED: {},
+ Attempt_ABNORMAL_FINISHED: {},
}
// Evolve attempts to evolve the state of this Attempt. If the state evolution
« no previous file with comments | « common/api/dm/service/v1/attempt_data.go ('k') | common/api/dm/service/v1/attempt_state_evolve_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698