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

Add the session and pool. #10

Merged
merged 11 commits into from
Dec 16, 2021

Conversation

Shylock-Hg
Copy link
Contributor

No description provided.

@Shylock-Hg Shylock-Hg requested a review from a team August 5, 2021 11:03
let resp = session.execute("YIELD 1").await.unwrap();
assert!(resp.error_code == common::types::ErrorCode::SUCCEEDED);

println!("{:?}", resp.data.unwrap());
Copy link
Contributor

Choose a reason for hiding this comment

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

add code to read the table value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

if self.conns.lock().unwrap().borrow_mut().is_empty() {
self.new_connection(1).await;
}
let conn = self.conns.lock().unwrap().borrow_mut().pop_back();
Copy link
Contributor

Choose a reason for hiding this comment

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

the connection pop from the list, and if the user does no return it, the pool couldn't close it. You need to make the pool can manage it when the use get it from the pool.

Copy link
Contributor

Choose a reason for hiding this comment

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

you need to make the connection is ok, here you can get a bad connection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The pool can't access the connection owned by session. It's designed to avoid some data race

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The keep-alive will add in later pr.


/// sign out the session
#[inline]
pub async fn signout(&self) -> std::result::Result<(), common::types::ErrorCode> {
Copy link
Contributor

Choose a reason for hiding this comment

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

modify the function name to release,
and the release function needs to return the connection to pool too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This had done in the drop method.

* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

pub trait DataSet {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ExcutionResponse wrapper

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's data set extension not related to the response.

@Shylock-Hg Shylock-Hg requested review from laura-ding and a team August 10, 2021 06:53
Copy link

@darionyaphet darionyaphet left a comment

Choose a reason for hiding this comment

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

LGTM

@Shylock-Hg Shylock-Hg merged commit e76ed34 into vesoft-inc:master Dec 16, 2021
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.

None yet

3 participants