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

potential deadlock in pkg/domain/sysvar_cache.go:121 domain.(*Domain).rebuildSysVarCache #48178

Closed
Tracked by #41316
YangKeao opened this issue Nov 1, 2023 · 2 comments
Assignees
Labels
component/test severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

YangKeao commented Nov 1, 2023

It's produced in CI:

POTENTIAL DEADLOCK:

Previous place where the lock was grabbed

goroutine 132 lock 0xc000ce2658

pkg/domain/sysvar_cache.go:121 domain.(*Domain).rebuildSysVarCache ??? <<<<<

pkg/domain/sysvar_cache.go:51 domain.(*Domain).rebuildSysVarCacheIfNeeded ???

pkg/domain/sysvar_cache.go:62 domain.(*Domain).GetSessionCache ???

pkg/session/session.go:3740 session.(*session).loadCommonGlobalVariablesIfNeeded ???

pkg/session/session.go:2132 session.(*session).ExecuteStmt ???

pkg/session/session.go:1645 session.(*session).ExecuteInternal ???

pkg/domain/domain.go:1630 domain.(*Domain).LoadPrivilegeLoop ???

pkg/session/session.go:3361 session.bootstrapSessionImpl ???

pkg/session/session.go:3282 session.BootstrapSession ???

pkg/session/session.go:3282 session.BootstrapSession ???

tests/realtikvtest/addindextest2/global_sort_test.go:83 addindextest2_test.TestGlobalSortBasic ???


Have been trying to lock it again for more than 20s

goroutine 273 lock 0xc000ce2658

pkg/domain/sysvar_cache.go:121 domain.(*Domain).rebuildSysVarCache ??? <<<<<

pkg/domain/sysvar_cache.go:51 domain.(*Domain).rebuildSysVarCacheIfNeeded ???

pkg/domain/sysvar_cache.go:75 domain.(*Domain).GetGlobalVar ???

pkg/domain/domain.go:1857 domain.(*Domain).LoadBindInfoLoop.(*Domain).globalBindHandleWorkerLoop.func1 ???

pkg/util/wait_group_wrapper.go:96 util.(*WaitGroupEnhancedWrapper).Run.func1 ???

https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fghpr_check2/detail/ghpr_check2/32519/pipeline/404

@Defined2014
Copy link
Contributor

I think it should be fixed by #40283 and #55407, so close this issue.

@Defined2014
Copy link
Contributor

Defined2014 commented Dec 11, 2024

After going deep into it, I found that I had misjudged it before. However, looking at the code, there is no deadlock in this place. It may be that bootstrap runs too slowly, causing the lock time to be too long. So keep close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants