Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch committed Aug 2, 2023
1 parent 5364c39 commit ec13e8c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/errs/errno.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const (
// NotServedErr indicates an tso node/pod received the requests for the keyspace groups which are not served by it.
// Note: keep the same as the ones defined on the server side, because the client side checks if an error message
// contains this string to judge whether the leader is changed.
NotServedErr = "is not served"
NotServedErr = "is not served"
// RetryTimeoutErr indicates the request is timeout.
RetryTimeoutErr = "retry timeout"
)

Expand Down Expand Up @@ -87,6 +88,7 @@ var (
ErrClientResourceGroupThrottled = errors.Normalize("exceeded resource group quota limitation", errors.RFCCodeText("PD:client:ErrClientResourceGroupThrottled"))
)

// ErrClientGetResourceGroup is the error type for getting resource group.
type ErrClientGetResourceGroup struct {
ResourceGroupName string
Cause string
Expand Down
1 change: 1 addition & 0 deletions client/resource_group/controller/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//revive:disable
package controller

import (
Expand Down
3 changes: 1 addition & 2 deletions client/resource_group/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,8 @@ func (gc *groupCostController) onRequestWait(
sub(gc.mu.consumption, delta)
gc.mu.Unlock()
return nil, nil, err
} else {
gc.successfulRequestDuration.Observe(d.Seconds())
}
gc.successfulRequestDuration.Observe(d.Seconds())
}

gc.mu.Lock()
Expand Down
2 changes: 2 additions & 0 deletions client/resource_group/controller/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ type tokenBucketReconfigureArgs struct {
NotifyThreshold float64
}

// LimiterOption is used to modify the Limiter during construction.
type LimiterOption func(*Limiter)

func resetLowProcess() func(*Limiter) {
Expand Down Expand Up @@ -386,6 +387,7 @@ func (lim *Limiter) reserveN(now time.Time, n float64, maxFutureReserve time.Dur
return r
}

// ResetRemainingNotifyTimes resets remainingNotifyTimes.
func (lim *Limiter) ResetRemainingNotifyTimes() {
lim.mu.Lock()
defer lim.mu.Unlock()
Expand Down
1 change: 1 addition & 0 deletions client/resource_group/controller/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type TestResponseInfo struct {
succeed bool
}

// NewTestResponseInfo creates a new TestResponseInfo.
func NewTestResponseInfo(readBytes uint64, kvCPU time.Duration, succeed bool) *TestResponseInfo {
return &TestResponseInfo{
readBytes: readBytes,
Expand Down

0 comments on commit ec13e8c

Please sign in to comment.