Skip to content

Commit

Permalink
Merge pull request #5361 from oasisprotocol/kostko/fix/rt-status-failed
Browse files Browse the repository at this point in the history
go/worker/common: Reset runtime provisioned status on failure
  • Loading branch information
kostko authored Sep 11, 2023
2 parents 6925b49 + a012888 commit 1c00e97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/5361.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/worker/common: Reset runtime provisioned status on failure
6 changes: 5 additions & 1 deletion go/worker/common/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,13 @@ func (n *Node) handleNewEventLocked(ev *roothash.Event) {

// Guarded by n.CrossNode.
func (n *Node) handleRuntimeHostEventLocked(ev *host.Event) {
if ev.Started != nil {
switch {
case ev.Started != nil:
atomic.StoreUint32(&n.hostedRuntimeProvisioned, 1)
case ev.FailedToStart != nil, ev.Stopped != nil:
atomic.StoreUint32(&n.hostedRuntimeProvisioned, 0)
}

for _, hooks := range n.hooks {
hooks.HandleRuntimeHostEventLocked(ev)
}
Expand Down

0 comments on commit 1c00e97

Please sign in to comment.