Skip to content

Commit 9ca8d7d

Browse files
committed
ptcache: fix error logging logic
Fix bug introduced in #144335 which accidentally suppresses this log. Epic: none Release note: None
1 parent c1e847b commit 9ca8d7d

File tree

1 file changed

+6
-2
lines changed
  • pkg/kv/kvserver/protectedts/ptcache

1 file changed

+6
-2
lines changed

pkg/kv/kvserver/protectedts/ptcache/cache.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,12 @@ func (c *Cache) periodicallyRefreshProtectedtsCache(ctx context.Context) {
188188
return
189189
}
190190
res := future.WaitForResult(ctx)
191-
if res.Err != nil && ctx.Err() != nil {
192-
log.Dev.Errorf(ctx, "failed to refresh protected timestamps: %v", res.Err)
191+
if res.Err != nil {
192+
// We expect an error if the context was cancelled, we don't want to log
193+
// in that case.
194+
if ctx.Err() == nil {
195+
log.Dev.Errorf(ctx, "failed to refresh protected timestamps: %v", res.Err)
196+
}
193197
}
194198
timer.Reset(protectedts.PollInterval.Get(&c.settings.SV))
195199
lastReset = timeutil.Now()

0 commit comments

Comments
 (0)