Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datarace from gin #7484

Closed
lhy1024 opened this issue Nov 30, 2023 · 2 comments · Fixed by #7778
Closed

Datarace from gin #7484

lhy1024 opened this issue Nov 30, 2023 · 2 comments · Fixed by #7778
Labels
type/ci The issue is related to CI.

Comments

@lhy1024
Copy link
Contributor

lhy1024 commented Nov 30, 2023

Bug Report

What did you do?

test

What did you expect to see?

no datarace

What did you see instead?

2023-11-29T22:43:41.4844371Z WARNING: DATA RACE
2023-11-29T22:43:41.4844760Z Write at 0x00000764dff8 by goroutine 21428:
2023-11-29T22:43:41.4845341Z   github.com/gin-gonic/gin.SetMode()
2023-11-29T22:43:41.4846345Z       /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/mode.go:70 +0x53
2023-11-29T22:43:41.4847217Z   github.com/tikv/pd/pkg/mcs/scheduling/server/apis/v1.NewService.func1()
2023-11-29T22:43:41.4848352Z       /home/runner/work/pd/pd/pkg/mcs/scheduling/server/apis/v1/api.go:98 +0x39
2023-11-29T22:43:41.4849103Z   sync.(*Once).doSlow()
2023-11-29T22:43:41.4849709Z       /opt/hostedtoolcache/go/1.21.4/x64/src/sync/once.go:74 +0xf0
2023-11-29T22:43:41.4850224Z   sync.(*Once).Do()
2023-11-29T22:43:41.4850841Z       /opt/hostedtoolcache/go/1.21.4/x64/src/sync/once.go:65 +0x44
2023-11-29T22:43:41.4851566Z   github.com/tikv/pd/pkg/mcs/scheduling/server/apis/v1.NewService()
2023-11-29T22:43:41.4852602Z       /home/runner/work/pd/pd/pkg/mcs/scheduling/server/apis/v1/api.go:95 +0x8b
2023-11-29T22:43:41.4853882Z   github.com/tikv/pd/pkg/mcs/scheduling/server/apis/v1.init.0.func1()
2023-11-29T22:43:41.4855211Z       /home/runner/work/pd/pd/pkg/mcs/scheduling/server/apis/v1/api.go:65 +0x57
2023-11-29T22:43:41.4856243Z   github.com/tikv/pd/pkg/mcs/scheduling/server.(*Server).SetUpRestHandler()
2023-11-29T22:43:41.4857423Z       /home/runner/work/pd/pd/pkg/mcs/scheduling/server/server.go:388 +0xd5
2023-11-29T22:43:41.4858180Z   github.com/tikv/pd/pkg/mcs/utils.StartGRPCAndHTTPServers()
2023-11-29T22:43:41.4858997Z       /home/runner/work/pd/pd/pkg/mcs/utils/util.go:222 +0x68a
2023-11-29T22:43:41.4859777Z   github.com/tikv/pd/pkg/mcs/scheduling/server.(*Server).startServer.func2()
2023-11-29T22:43:41.4860785Z       /home/runner/work/pd/pd/pkg/mcs/scheduling/server/server.go:433 +0x6b
2023-11-29T22:43:41.4861408Z 
2023-11-29T22:43:41.4861753Z Previous read at 0x00000764dff8 by goroutine 391:
2023-11-29T22:43:41.4862490Z   github.com/gin-gonic/gin.IsDebugging()
2023-11-29T22:43:41.4863615Z       /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/debug.go:20 +0x64
2023-11-29T22:43:41.4864547Z   github.com/gin-gonic/gin.debugPrintRoute()
2023-11-29T22:43:41.4865702Z       /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/debug.go:27 +0x6d
2023-11-29T22:43:41.4866694Z   github.com/gin-gonic/gin.(*Engine).addRoute()
2023-11-29T22:43:41.4868097Z       /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:327 +0xc7
2023-11-29T22:43:41.4869321Z   github.com/gin-gonic/gin.(*RouterGroup).handle()
2023-11-29T22:43:41.4870486Z       /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/routergroup.go:89 +0x1d2
2023-11-29T22:43:41.4871365Z   github.com/gin-gonic/gin.(*RouterGroup).GET()
2023-11-29T22:43:41.4872745Z       /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/routergroup.go:117 +0x184
2023-11-29T22:43:41.4874135Z   github.com/pingcap/tidb-dashboard/pkg/apiserver/slowquery.registerRouter()
2023-11-29T22:43:41.4876333Z       /home/runner/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20231127105651-ce4097837c5e/pkg/apiserver/slowquery/service.go:44 +0x6a
2023-11-29T22:43:41.4878131Z   runtime.call32()
2023-11-29T22:43:41.4879294Z       /opt/hostedtoolcache/go/1.21.4/x64/src/runtime/asm_amd64.s:748 +0x42
2023-11-29T22:43:41.4880362Z   reflect.Value.Call()
2023-11-29T22:43:41.4881410Z       /opt/hostedtoolcache/go/1.21.4/x64/src/reflect/value.go:380 +0xb5
2023-11-29T22:43:41.4882264Z   go.uber.org/dig.(*Container).Invoke()
2023-11-29T22:43:41.4882952Z       /home/runner/go/pkg/mod/go.uber.org/dig@v1.9.0/dig.go:397 +0x46e
2023-11-29T22:43:41.4883686Z   go.uber.org/fx.(*App).executeInvokes()
2023-11-29T22:43:41.4884632Z       /home/runner/go/pkg/mod/go.uber.org/fx@v1.12.0/app.go:659 +0x2a9
2023-11-29T22:43:41.4885565Z   go.uber.org/fx.New()
2023-11-29T22:43:41.4886415Z       /home/runner/go/pkg/mod/go.uber.org/fx@v1.12.0/app.go:438 +0x894
2023-11-29T22:43:41.4887385Z   github.com/pingcap/tidb-dashboard/pkg/apiserver.(*Service).Start()
2023-11-29T22:43:41.4888702Z       /home/runner/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20231127105651-ce4097837c5e/pkg/apiserver/apiserver.go:153 +0xa52
2023-11-29T22:43:41.4889806Z   github.com/tikv/pd/pkg/dashboard/adapter.(*Manager).startService()
2023-11-29T22:43:41.4890733Z       /home/runner/work/pd/pd/pkg/dashboard/adapter/manager.go:198 +0x11d
2023-11-29T22:43:41.4891475Z   github.com/tikv/pd/pkg/dashboard/adapter.(*Manager).checkAddress()
2023-11-29T22:43:41.4892605Z       /home/runner/work/pd/pd/pkg/dashboard/adapter/manager.go:152 +0x686
2023-11-29T22:43:41.4894004Z   github.com/tikv/pd/pkg/dashboard/adapter.(*Manager).serviceLoop()
2023-11-29T22:43:41.4895491Z       /home/runner/work/pd/pd/pkg/dashboard/adapter/manager.go:94 +0x298
2023-11-29T22:43:41.4897114Z   github.com/tikv/pd/pkg/dashboard/adapter.(*Manager).Start.func1()
2023-11-29T22:43:41.4898582Z       /home/runner/work/pd/pd/pkg/dashboard/adapter/manager.go:66 +0x33

https://github.com/lhy1024/pd/actions/runs/7045347176/job/19174873682

What version of PD are you using (pd-server -V)?

@lhy1024 lhy1024 added the type/bug The issue is confirmed as a bug. label Nov 30, 2023
@lhy1024
Copy link
Contributor Author

lhy1024 commented Nov 30, 2023

it is from gin-gonic/gin#1180

@lhy1024 lhy1024 removed the type/bug The issue is confirmed as a bug. label Nov 30, 2023
@ti-chi-bot ti-chi-bot bot added the needs-type Indicates an issue requires a type label. label Nov 30, 2023
@lhy1024 lhy1024 added the type/ci The issue is related to CI. label Nov 30, 2023
@ti-chi-bot ti-chi-bot bot removed the needs-type Indicates an issue requires a type label. label Nov 30, 2023
@ti-chi-bot ti-chi-bot bot closed this as completed in #7778 Feb 1, 2024
ti-chi-bot bot pushed a commit that referenced this issue Feb 1, 2024
close #7484

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/ci The issue is related to CI.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants