Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
PIP-1490: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Jan 24, 2022
1 parent 1adaf52 commit 091a76f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
7 changes: 0 additions & 7 deletions benchmark_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ func BenchmarkCache(b *testing.B) {
},
LockRequired: true,
},
// {
// Name: "SyncLRUCache",
// NewTestCache: func() gubernator.Cache{
// return gubernator.NewSyncLRUCache(0)
// },
// LockRequired: false,
// },
}

for _, testCase := range testCases {
Expand Down
3 changes: 2 additions & 1 deletion gubernator.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ func (s *V1Instance) asyncRequests(ctx context.Context, req *AsyncReq) {
WithError(err).
WithField("key", req.Key).
Error("Error fetching rate limit from peer")
// countError(err, "Error in GetPeerRateLimit")
// Not calling `countError()` because we expect the remote end to
// report this error.
ext.LogError(span, err2)
resp.Resp = &RateLimitResp{Error: err2.Error()}
break
Expand Down
14 changes: 10 additions & 4 deletions gubernator_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ package gubernator
// processes requests sequentially.
//
// Request workflow:
// - A 63-bit hash is generated from an incoming request by its Key/Name values. (Actually 64 bit, but we toss out one bit to properly calculate the next step.)
// - Workers are assigned equal size hash ranges. The worker is selected by choosing the worker index associated with that linear hash value range.
// - The worker has command channels for each method call. The request is enqueued to the appropriate channel.
// - The worker pulls the request from the appropriate channel and executes the business logic for that method. Then, it sends a response back using the requester's provided response channel.
// - A 63-bit hash is generated from an incoming request by its Key/Name
// values. (Actually 64 bit, but we toss out one bit to properly calculate
// the next step.)
// - Workers are assigned equal size hash ranges. The worker is selected by
// choosing the worker index associated with that linear hash value range.
// - The worker has command channels for each method call. The request is
// enqueued to the appropriate channel.
// - The worker pulls the request from the appropriate channel and executes the
// business logic for that method. Then, it sends a response back using the
// requester's provided response channel.

import (
"context"
Expand Down

0 comments on commit 091a76f

Please sign in to comment.