Skip to content

Commit

Permalink
Issue Number: ref pingcap#8854
Browse files Browse the repository at this point in the history
fix CI.

Signed-off-by: Ping Yu <[email protected]>
  • Loading branch information
pingyu committed Mar 25, 2023
1 parent 3fbcde0 commit 0b2afdc
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 0 additions & 2 deletions domain/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func TestNormalSessionPool(t *testing.T) {
svr, err := server.NewServer(conf, nil)
require.NoError(t, err)
svr.SetDomain(domain)
svr.InitGlobalConnID(domain.ServerID)
info.SetSessionManager(svr)

pool := domain.SysSessionPool()
Expand Down Expand Up @@ -117,7 +116,6 @@ func TestAbnormalSessionPool(t *testing.T) {
svr, err := server.NewServer(conf, nil)
require.NoError(t, err)
svr.SetDomain(domain)
svr.InitGlobalConnID(domain.ServerID)
info.SetSessionManager(svr)

pool := domain.SysSessionPool()
Expand Down
Empty file modified domain/domain.go
100755 → 100644
Empty file.
Empty file modified server/conn.go
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"math/rand"
"net"
"net/http" //nolint:goimports

// For pprof
_ "net/http/pprof" // #nosec G108
"os"
Expand Down
7 changes: 5 additions & 2 deletions util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ go_library(
"cpu_windows.go",
"errors.go",
"etcd.go",
"global_conn_id.go",
"gogc.go",
"misc.go",
"prefix_helper.go",
Expand Down Expand Up @@ -38,6 +39,8 @@ go_library(
"//util/logutil",
"//util/memory",
"//util/tls",
"@com_github_cznic_mathutil//:mathutil",
"@com_github_ngaut_sync2//:sync2",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_log//:log",
Expand All @@ -56,10 +59,10 @@ go_test(
timeout = "short",
srcs = [
"errors_test.go",
"global_conn_id_test.go",
"main_test.go",
"misc_test.go",
"prefix_helper_test.go",
"processinfo_test.go",
"security_test.go",
"urls_test.go",
"util_test.go",
Expand All @@ -70,7 +73,6 @@ go_test(
flaky = True,
shard_count = 50,
deps = [
"//config",
"//kv",
"//parser",
"//parser/model",
Expand All @@ -82,6 +84,7 @@ go_test(
"//types",
"//util/fastrand",
"//util/memory",
"@com_github_cznic_mathutil//:mathutil",
"@com_github_pingcap_errors//:errors",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
Expand Down
14 changes: 7 additions & 7 deletions util/global_conn_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (a *SimpleConnIDAllocator) Init() {
}

// SetServerIDGetter implements ConnIDAllocator interface.
func (a *SimpleConnIDAllocator) SetServerIDGetter(_ serverIDGetterFn) {
func (*SimpleConnIDAllocator) SetServerIDGetter(_ serverIDGetterFn) {
// do nothing
}

Expand All @@ -93,7 +93,7 @@ func (a *SimpleConnIDAllocator) Release(id uint64) {
}

// GetReservedConnID implements ConnIDAllocator interface.
func (a *SimpleConnIDAllocator) GetReservedConnID(reservedNo uint64) uint64 {
func (*SimpleConnIDAllocator) GetReservedConnID(reservedNo uint64) uint64 {
return reservedNo
}

Expand Down Expand Up @@ -364,9 +364,9 @@ func (p *AutoIncPool) Put(id uint64) (ok bool) {
func (p *AutoIncPool) Len() int {
if p.existed != nil {
p.mu.Lock()
len := len(p.existed)
length := len(p.existed)
p.mu.Unlock()
return len
return length
}
return -1
}
Expand Down Expand Up @@ -452,10 +452,10 @@ func (p LockFreeCircularPool) String() string {
tail := p.tail.Get()
headSlot := &p.slots[head&(p.cap-1)]
tailSlot := &p.slots[tail&(p.cap-1)]
len := tail - head
length := tail - head

return fmt.Sprintf("cap:%v, len:%v; head:%x, slot:{%x,%x}; tail:%x, slot:{%x,%x}",
p.cap, len, head, headSlot.value, headSlot.seq, tail, tailSlot.value, tailSlot.seq)
return fmt.Sprintf("cap:%v, length:%v; head:%x, slot:{%x,%x}; tail:%x, slot:{%x,%x}",
p.cap, length, head, headSlot.value, headSlot.seq, tail, tailSlot.value, tailSlot.seq)
}

// Put implements IDPool interface.
Expand Down
4 changes: 2 additions & 2 deletions util/global_conn_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ func (p LockBasedCircularPool) String() string {
tail := p.tail
headVal := p.slots[head&(p.cap-1)]
tailVal := p.slots[tail&(p.cap-1)]
len := tail - head
length := tail - head

return fmt.Sprintf("cap:%v, len:%v; head:%x, slot:{%x}; tail:%x, slot:{%x}",
p.cap, len, head, headVal, tail, tailVal)
p.cap, length, head, headVal, tail, tailVal)
}

func (p *LockBasedCircularPool) Put(val uint64) (ok bool) {
Expand Down

0 comments on commit 0b2afdc

Please sign in to comment.