Skip to content

Commit

Permalink
Merge pull request #103339 from nicktrav/nickt.23.1-disk-ops
Browse files Browse the repository at this point in the history
release-23.1: storage: close over disk slow event listener
  • Loading branch information
nicktrav authored May 15, 2023
2 parents ea3962e + d748383 commit b1bab79
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/storage/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,14 @@ func wrapFilesystemMiddleware(opts *pebble.Options) (vfs.FS, io.Closer) {
// wraps the filesystem with a layer that times all write-oriented
// operations.
fs, closer := vfs.WithDiskHealthChecks(opts.FS, diskHealthCheckInterval,
opts.EventListener.DiskSlow)
func(info vfs.DiskSlowInfo) {
opts.EventListener.DiskSlow(pebble.DiskSlowInfo{
Path: info.Path,
OpType: info.OpType,
Duration: info.Duration,
WriteSize: info.WriteSize,
})
})
// If we encounter ENOSPC, exit with an informative exit code.
fs = vfs.OnDiskFull(fs, func() {
exit.WithCode(exit.DiskFull())
Expand Down

0 comments on commit b1bab79

Please sign in to comment.