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

Conversation

Jabinst
Copy link
Contributor

@Jabinst Jabinst commented Jun 28, 2021

这里由于getIdleConnNum()被调用了两次,在高并发的极端情况下,有可能第一次得到1,第二次得到0,这样导致retry被赋值了0,从而跳过了下方while循环,则该次session的请求跳过60s阻塞等待,直接抛出了NotValidConnectionException异常

在高并发的极端情况下,有可能第一次得到1,第二次得到0,
这样导致retry被赋值了0,从而跳过了下方while循环,
则该次session的请求跳过60s阻塞等待,
直接抛出了NotValidConnectionException异常
@CLAassistant
Copy link

CLAassistant commented Jun 28, 2021

CLA assistant check
All committers have signed the CLA.

@@ -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

@laura-ding laura-ding merged commit d466095 into vesoft-inc:master Jun 28, 2021
@jamieliu1023
Copy link

@Jabinst Thanks for your contribution to the Nebula Graph community! This is Jamie with Nebula and I'd like to email you the Nebula Contributor certificate and ship you a mug to mark this special moment. Could you please kindly reach me via jamie.liu(at)vesoft.com? Again, thanks for being a part of the Nebula community!

laura-ding added a commit that referenced this pull request Aug 10, 2021
* Fix reconnect failed when all connections are idle status (#303)

* fix reconnect failed when all connection are broken idle

* add test

* fix null object (#301)

* fix thread pool while iterate result (#311)

* fix thread pool while iterate result

* add close for example

* 这里由于getIdleConnNum()被调用了两次, (#319)

fix getConnection() under the high concurrency return the wrong result

Co-authored-by: laura-ding <48548375+laura-ding@users.noreply.github.com>

* fix the toString of path (#327)

* Add SessionsManager and test (#330)

* add session manager

* Add comments

* modify get index

* Added reconnection handling for all service exceptions

* fix encoder without string col (#290)

* fix encoder with chinese value (#308)

Co-authored-by: Anqi <16240361+Nicole00@users.noreply.github.com>

* delete SessionManager and fix confilct

* filter online storaged hosts & add test (#326)

* filter the online hosts for storaged

* add test for listHosts

* add expired_time_factor config

* extract printProcessStatus function as util

* fix comments

* get the latest schema & add test (#316)

* get the latest schema

* add test for multi version schema

* add vid type for CREATE SPACE NGQL

* add vid type

* update vid length

Co-authored-by: laura-ding <48548375+laura-ding@users.noreply.github.com>

* modify the config of the pom to auto deploy (#329)

* cherry-pick bugfix

* modify the version

* modify version

* fix metaclient test

* fix timeout problem

* modify the waittime

Co-authored-by: Anqi <16240361+Nicole00@users.noreply.github.com>
Co-authored-by: Zhang Binbin <30758230+Jabinst@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants