From 091a76f88745684ef8bbfd2390656d935610beec Mon Sep 17 00:00:00 2001 From: Shawn Poulson Date: Mon, 24 Jan 2022 15:03:19 -0500 Subject: [PATCH] PIP-1490: Clean up. --- benchmark_cache_test.go | 7 ------- gubernator.go | 3 ++- gubernator_pool.go | 14 ++++++++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmark_cache_test.go b/benchmark_cache_test.go index 4ad2a77f..7e66aef9 100644 --- a/benchmark_cache_test.go +++ b/benchmark_cache_test.go @@ -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 { diff --git a/gubernator.go b/gubernator.go index 5425b1f6..6147a021 100644 --- a/gubernator.go +++ b/gubernator.go @@ -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 diff --git a/gubernator_pool.go b/gubernator_pool.go index 5671675c..2ffe9665 100644 --- a/gubernator_pool.go +++ b/gubernator_pool.go @@ -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"