Skip to content

Commit

Permalink
Merge pull request #41 from exaring/do_not_consider_canceled_context_…
Browse files Browse the repository at this point in the history
…as_peer_error

feat: do not count context cancelation as peer error
  • Loading branch information
thrawn01 committed May 23, 2022
2 parents ef11a3a + f0dbe18 commit 87609ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions groupcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ func (g *Group) load(ctx context.Context, key string, dest Sink) (value ByteView
if err == nil {
g.Stats.PeerLoads.Add(1)
return value, nil
} else if errors.Is(err, context.Canceled) {
// do not count context cancellation as a peer error
return nil, err
}

if logger != nil {
Expand Down

0 comments on commit 87609ae

Please sign in to comment.