Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
core/runner: Fix server panic when runner is forgotten
Browse files Browse the repository at this point in the history
Before this commit when Waypoint was determining whether or not to
remove a Runner from boltdb it was possible for runner to be nil at the
time we attempted to determine what type of Runner the Runner was. This
caused the server to panic as soon as the runner became unavailable.

This commit fixes the panic by avoiding the runner from being set to nil
by instead initializing an empty runner variable so that if a runner is
not found the type can still be determined and the runner cleaned up.

Fixes #3448
  • Loading branch information
demophoon committed Aug 29, 2022
1 parent b82da86 commit 9735434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/server/boltdbstate/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,10 @@ func (s *State) runnerSetAdoptionState(
}

func (s *State) runnerOffline(dbTxn *bolt.Tx, memTxn *memdb.Txn, id string) error {
var r *pb.Runner

r, err := s.runnerById(dbTxn, id)
if status.Code(err) == codes.NotFound {
r = nil
err = nil
}
if err != nil {
Expand Down

0 comments on commit 9735434

Please sign in to comment.