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

br: goleak detected leaked go routine in int test #58624

Open
Tristan1900 opened this issue Dec 30, 2024 · 0 comments · May be fixed by #58626
Open

br: goleak detected leaked go routine in int test #58624

Tristan1900 opened this issue Dec 30, 2024 · 0 comments · May be fixed by #58626
Labels
component/br This issue is related to BR of TiDB. severity/minor type/bug The issue is confirmed as a bug.

Comments

@Tristan1900
Copy link
Contributor

Bug Report

coverage: 11.3% of statements in github.com/pingcap/tidb/br/...
goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 779 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc003c89730, {0x7792e00, 0xc003c80870})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 777 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc003c896d0, {0x7792e00, 0xc003c807d0})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 778 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc003c89700, {0x7792e00, 0xc003c80820})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 641 in state select, with google.golang.org/grpc/internal/transport.(*http2Client).keepalive on top of the stack:
google.golang.org/grpc/internal/transport.(*http2Client).keepalive(0xc00183b8c8)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:1676 +0x137
created by google.golang.org/grpc/internal/transport.newHTTP2Client in goroutine 780
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:399 +0x1dbb
 Goroutine 775 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc003c89150, {0x7792e00, 0xc003c805a0})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 889 in state select, with google.golang.org/grpc/internal/transport.(*http2Client).keepalive on top of the stack:
google.golang.org/grpc/internal/transport.(*http2Client).keepalive(0xc0043d6488)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:1676 +0x137
created by google.golang.org/grpc/internal/transport.newHTTP2Client in goroutine 776
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:399 +0x1dbb
 Goroutine 773 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc003c890f0, {0x7792e00, 0xc003c80500})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 774 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc003c89120, {0x7792e00, 0xc003c80550})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 932 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc002ffd990, {0x7792e00, 0xc0017776d0})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 931 in state select, with google.golang.org/grpc/internal/transport.(*controlBuffer).get on top of the stack:
google.golang.org/grpc/internal/transport.(*controlBuffer).get(0xc001777450, 0x1)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:418 +0x113
google.golang.org/grpc/internal/transport.(*loopyWriter).run(0xc0044a05b0)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:551 +0x7b
google.golang.org/grpc/internal/transport.newHTTP2Client.func6()
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:463 +0x85
created by google.golang.org/grpc/internal/transport.newHTTP2Client in goroutine 780
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:461 +0x23d3
 Goroutine 891 in state select, with google.golang.org/grpc/internal/transport.(*controlBuffer).get on top of the stack:
google.golang.org/grpc/internal/transport.(*controlBuffer).get(0xc0043a4640, 0x1)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:418 +0x113
google.golang.org/grpc/internal/transport.(*loopyWriter).run(0xc000db35e0)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:551 +0x7b
google.golang.org/grpc/internal/transport.newHTTP2Client.func6()
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:463 +0x85
created by google.golang.org/grpc/internal/transport.newHTTP2Client in goroutine 776
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:461 +0x23d3
 Goroutine 933 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc002ffd9c0, {0x7792e00, 0xc001777720})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 934 in state select, with google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run on top of the stack:
google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run(0xc002ffd9f0, {0x7792e00, 0xc001777770})
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:76 +0x10c
created by google.golang.org/grpc/internal/grpcsync.NewCallbackSerializer in goroutine 105
	/go/pkg/mod/google.golang.org/[email protected]/internal/grpcsync/callback_serializer.go:52 +0x11a
 Goroutine 938 in state select, with google.golang.org/grpc/internal/transport.(*http2Client).keepalive on top of the stack:
google.golang.org/grpc/internal/transport.(*http2Client).keepalive(0xc0044f8008)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:1676 +0x137
created by google.golang.org/grpc/internal/transport.newHTTP2Client in goroutine 815
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:399 +0x1dbb
 Goroutine 940 in state select, with google.golang.org/grpc/internal/transport.(*controlBuffer).get on top of the stack:
google.golang.org/grpc/internal/transport.(*controlBuffer).get(0xc001777b80, 0x1)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:418 +0x113
google.golang.org/grpc/internal/transport.(*loopyWriter).run(0xc0044a1340)
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/controlbuf.go:551 +0x7b
google.golang.org/grpc/internal/transport.newHTTP2Client.func6()
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:463 +0x85
created by google.golang.org/grpc/internal/transport.newHTTP2Client in goroutine 815
	/go/pkg/mod/google.golang.org/[email protected]/internal/transport/http2_client.go:461 +0x23d3
 Goroutine 654 in state select, with github.com/pingcap/tidb/br/pkg/restore.(*ImportModeSwitcher).GoSwitchToImportMode.func1 on top of the stack:
github.com/pingcap/tidb/br/pkg/restore.(*ImportModeSwitcher).GoSwitchToImportMode.func1()
	/home/jenkins/agent/workspace/pingcap/tidb/pull_br_integration_test/tidb/br/pkg/restore/import_mode_switcher.go:163 +0x10d
created by github.com/pingcap/tidb/br/pkg/restore.(*ImportModeSwitcher).GoSwitchToImportMode in goroutine 105
	/home/jenkins/agent/workspace/pingcap/tidb/pull_br_integration_test/tidb/br/pkg/restore/import_mode_switcher.go:155 +0x35c
]
script returned exit code 1

looks like in import_mode_switcher.go we didn't use the parent ctx and create a new one instead so when test cancelled the go routine didn't exit

@Tristan1900 Tristan1900 added the type/bug The issue is confirmed as a bug. label Dec 30, 2024
@Tristan1900 Tristan1900 changed the title br: goleak detected leaded go routine in int test br: goleak detected leaked go routine in int test Dec 30, 2024
@Tristan1900 Tristan1900 linked a pull request Dec 30, 2024 that will close this issue
13 tasks
@BornChanger BornChanger added severity/minor component/br This issue is related to BR of TiDB. labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants