Skip to content

Commit 87609ae

Browse files
authored
Merge pull request #41 from exaring/do_not_consider_canceled_context_as_peer_error
feat: do not count context cancelation as peer error
2 parents ef11a3a + f0dbe18 commit 87609ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

groupcache.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ func (g *Group) load(ctx context.Context, key string, dest Sink) (value ByteView
386386
if err == nil {
387387
g.Stats.PeerLoads.Add(1)
388388
return value, nil
389+
} else if errors.Is(err, context.Canceled) {
390+
// do not count context cancellation as a peer error
391+
return nil, err
389392
}
390393

391394
if logger != nil {

0 commit comments

Comments
 (0)