-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
domain,session: simplify the session pool of domain #8456
Conversation
The session pool now just serve as a cache, close the pool will no longer wait for all resources to be put back to the pool. Fix the bug that TiDB may hang a long time even after it get the exit signal
} | ||
} | ||
|
||
func (p *sessionPool) Get() (resource pools.Resource, err error) { |
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.
should we check p.mu.closed
?
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.
Not necessary.
line 629 handles the sessionPool is closed scene.
LGTM |
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.
LGTM
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.
Reviewed 2 of 3 files at r1, 1 of 1 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lysu)
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.
Reviewed 3 of 3 files at r1, 1 of 1 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lysu)
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.
Reviewed 1 of 1 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved
What problem does this PR solve?
Fix the bug that TiDB may hang a long time even after it get the exit signal.
DDL or stats may take sessions from the session pool to
ExecRestrictedSQL
for a long time,while the old pool will block waiting until the session to put back to the pool.
What is changed and how it works?
The session pool now just serve as a cache, close the pool will no longer
wait for all resources to be put back to the pool.
Check List
Tests
PTAL @winkyao @zimulala
This change is