Skip to content

Commit 6c44381

Browse files
committed
feedback
1 parent 70c8b89 commit 6c44381

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

block/internal/reaping/reaper.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"encoding/hex"
77
"errors"
88
"fmt"
9+
"runtime"
910
"sync"
1011
"time"
1112

@@ -96,7 +97,7 @@ func (r *Reaper) reaperLoop() {
9697
r.logger.Warn().
9798
Err(err).
9899
Int("consecutive_failures", consecutiveFailures).
99-
Dur("backoff", backoff).
100+
Dur("next_retry_in", backoff).
100101
Msg("reaper error, backing off")
101102
if r.wait(backoff, nil) {
102103
return
@@ -110,9 +111,13 @@ func (r *Reaper) reaperLoop() {
110111
}
111112

112113
if submitted {
114+
runtime.Gosched()
113115
continue
114116
}
115117

118+
// Note: if the cleanup ticker fires before the idle interval elapses,
119+
// the remaining idle duration is discarded. drainMempool() is called
120+
// immediately and a fresh idle wait starts from scratch.
116121
if r.wait(r.interval, cleanupTicker.C) {
117122
return
118123
}

0 commit comments

Comments
 (0)