Skip to content

Commit

Permalink
Merge pull request #5453 from oasisprotocol/peternose/bugfix/runtime-…
Browse files Browse the repository at this point in the history
…abort

go/worker/compute: Abort runtimes only on timeouts
  • Loading branch information
peternose authored Nov 17, 2023
2 parents 211979b + 65d9a71 commit 8d9b3f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/5453.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/worker/compute: Abort runtimes only on timeouts
2 changes: 1 addition & 1 deletion go/runtime/host/sandbox/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func (r *sandboxedRuntime) handleAbortRequest(rq *abortRequest) error {
return nil
}

r.logger.Warn("restarting runtime", "force_restart", rq.force, "abbort_err", err, "abort_resp", response)
r.logger.Warn("restarting runtime", "force_restart", rq.force, "abort_err", err, "abort_resp", response)

// Failed to gracefully interrupt the runtime. Kill the runtime and it will be automatically
// restarted by the manager after it dies.
Expand Down
8 changes: 7 additions & 1 deletion go/worker/compute/executor/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,15 @@ func (n *Node) runtimeExecuteTxBatch(
}()

// Ensure batch execution is bounded.
//
// Note: We intentionally never abort batch execution when ctx is canceled
// (e.g., when a round ends or when a proposal with a higher rank is received)
// to prevent runtimes from restarting, as abort requests are currently not
// supported. Execution shouldn't take a significant amount of time anyway
// unless something is seriously wrong.
proposerTimeout := state.Runtime.TxnScheduler.ProposerTimeout
callCtx, cancelCallFn := context.WithTimeoutCause(
ctx,
context.TODO(), // Replace with ctx once runtimes start supporting abort requests.
executeBatchTimeoutFactor*proposerTimeout,
errors.New("proposer timeout expired"),
)
Expand Down

0 comments on commit 8d9b3f8

Please sign in to comment.