File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments