-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: add a reference count for StmtCtx #39368
Conversation
This reverts commit 17e6297.
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@@ -294,6 +294,7 @@ func (record *memoryUsageAlarm) getTop10SqlInfo(cmp func(i, j *util.ProcessInfo) | |||
} | |||
buf.WriteString("\n") | |||
} | |||
totalCnt-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to update info
here?
util/util.go
Outdated
@@ -106,6 +106,11 @@ func Str2Int64Map(str string) map[int64]struct{} { | |||
|
|||
// GenLogFields generate log fields. | |||
func GenLogFields(costTime time.Duration, info *ProcessInfo, needTruncateSQL bool) []zap.Field { | |||
if !info.RefCountOfStmtCtx.TryIncrease() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So other threads can only access StmtCtx
by this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. But it seems we only encounter problems here.😅
@XuHuaiyu PTAL
|
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b9f9e37
|
/merge |
In response to a cherrypick label: new pull request created: #39424. |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #39425. |
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #39426. |
TiDB MergeCI notify✅ Well Done! New fixed [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #27725
Problem Summary:
What is changed and how it works?
Check List
Tests
Using commit: 17e6297
run
Before this commit, tidb-server will panic.
After this commit, tidb-server run successfully.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.