Skip to content

Commit

Permalink
go/runtime: ensure we destroy a SQLite store on Open error
Browse files Browse the repository at this point in the history
We were not properly tearning down these instances, which lead to
lingering open RocksDB instances and open file descriptors to removed
files, preventing disk from being reclaimed.
  • Loading branch information
jgraettinger committed Nov 3, 2024
1 parent 597284e commit da63b96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/runtime/derive.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ func NewDeriveApp(host *FlowConsumer, shard consumer.Shard, recorder *recoverylo
base.drop()
return nil, fmt.Errorf("building SQLite backing store: %w", err)
} else if err = sqlite.Open(""); err != nil {
sqlite.Destroy()
base.drop()
return nil, fmt.Errorf("opening SQLite backing store: %w", err)
} else if err = sqlite.SQLiteDB.Close(); err != nil {
sqlite.Destroy()
base.drop()
return nil, fmt.Errorf("closing SQLite DB in preparation for opening it again: %w", err)
}
Expand Down

0 comments on commit da63b96

Please sign in to comment.