Skip to content

Commit

Permalink
go/worker/common: Reorder state determination checks
Browse files Browse the repository at this point in the history
Otherwise the shown state would be misleading, e.g. showing that it is
waiting for runtime host being provisioned while it is actually blocked
in initialization like storage sync.
  • Loading branch information
kostko committed Oct 28, 2022
1 parent 697665a commit ca81c1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/worker/common/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ func (n *Node) getStatusStateLocked() api.StatusState {
if atomic.LoadUint32(&n.keymanagerAvailable) == 0 {
return api.StatusStateWaitingKeymanager
}
if atomic.LoadUint32(&n.hostedRuntimeProvisioned) == 0 {
return api.StatusStateWaitingHostedRuntime
}
if atomic.LoadUint32(&n.historyReindexingDone) == 0 {
return api.StatusStateWaitingHistoryReindex
}
if atomic.LoadUint32(&n.workersInitialized) == 0 {
return api.StatusStateWaitingWorkersInit
}
if atomic.LoadUint32(&n.hostedRuntimeProvisioned) == 0 {
return api.StatusStateWaitingHostedRuntime
}
// If resumeCh exists the runtime is suspended (safe to check since the cross node lock should be held).
if n.resumeCh != nil {
return api.StatusStateRuntimeSuspended
Expand Down

0 comments on commit ca81c1c

Please sign in to comment.