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

getConnection()时,极端情况会跳过阻塞等待,直接抛出NotValidConnectionException异常 #319

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ protected void returnConnection(SyncConnection connection) {

protected SyncConnection getConnection() throws NotValidConnectionException, IOErrorException {
// If no idle connection, try once
int retry = getIdleConnNum() == 0 ? 1 : getIdleConnNum();
int idleConnNum = getIdleConnNum();
int retry = idleConnNum == 0 ? 1 : idleConnNum;
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch

SyncConnection connection = null;
boolean hasOkConn = false;
try {
Expand Down