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

domain,session: simplify the session pool of domain #8456

Merged
merged 6 commits into from
Nov 27, 2018

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Nov 26, 2018

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

  • No code (actually a refactor, no new code)

PTAL @winkyao @zimulala


This change is Reviewable

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
@zz-jason zz-jason added type/enhancement The issue or PR belongs to an enhancement. component/server labels Nov 27, 2018
@tiancaiamao tiancaiamao added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Nov 27, 2018
@tiancaiamao
Copy link
Contributor Author

@lysu

}
}

func (p *sessionPool) Get() (resource pools.Resource, err error) {
Copy link
Member

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?

Copy link
Contributor Author

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.

domain/domain.go Show resolved Hide resolved
domain/domain.go Show resolved Hide resolved
@lysu
Copy link
Contributor

lysu commented Nov 27, 2018

LGTM

@lysu lysu added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 27, 2018
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zz-jason zz-jason left a 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)

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1, 1 of 1 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lysu)

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/server priority/release-blocker This issue blocks a release. Please solve it ASAP. status/LGT1 Indicates that a PR has LGTM 1. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants