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

comment the graph::session module (Part 1) #3878

Merged
merged 9 commits into from
Feb 14, 2022

Conversation

zhaohaifei
Copy link
Contributor

@zhaohaifei zhaohaifei commented Feb 10, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

#3858

Description:

Just comment graph::session module.

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@zhaohaifei zhaohaifei changed the title Modify and comment session comment the graph::session module(PART 1) Feb 10, 2022
@zhaohaifei zhaohaifei changed the title comment the graph::session module(PART 1) comment the graph::session module (Part 1) Feb 10, 2022
@zhaohaifei zhaohaifei added ready-for-testing PR: ready for the CI test ready for review labels Feb 10, 2022
@zhaohaifei zhaohaifei linked an issue Feb 10, 2022 that may be closed by this pull request
@zhaohaifei zhaohaifei added this to the v3.1.0 milestone Feb 10, 2022
@zhaohaifei zhaohaifei requested review from yixinglu and Aiee and removed request for yixinglu February 10, 2022 10:31
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add //

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌

@zhaohaifei zhaohaifei removed the ready-for-testing PR: ready for the CI test label Feb 10, 2022
@zhaohaifei zhaohaifei added wip Solution: work in progress ready for review and removed ready for review wip Solution: work in progress labels Feb 11, 2022
@@ -23,8 +23,15 @@ struct SpaceInfo {
meta::cpp2::SpaceDesc spaceDesc;
};

// A ClientSession is equivalent to a connection between a client and a server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Session is not equivalent to connection. E.G. session could be saved in cluster even after connection broken.

class ClientSession final {
public:
// Creates a new ClientSession.
// session: session obj used in RPC.
// metaClient: used to communicate with meta server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add The information of session will be persisted in meta server.

@@ -143,7 +144,8 @@ void GraphSessionManager::removeSession(SessionID id) {
return;
}

iter->second->markAllQueryKilled();
iter->second->markAllQueryKilled(); // Before removing the session, all queries on the session
Copy link
Contributor

Choose a reason for hiding this comment

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

Put multiple-lines comment in front.

@@ -217,7 +219,8 @@ void GraphSessionManager::updateSessionsToMeta() {
}
}

auto handleKilledQueries = [this](auto&& resp) {
auto handleKilledQueries = [this](auto&& resp) { // There may be expired queries, and the
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@zhaohaifei zhaohaifei added the ready-for-testing PR: ready for the CI test label Feb 14, 2022
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.
Copy link
Contributor

Choose a reason for hiding this comment

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

why change the comment format? This changes maybe invalidate the license checker.

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 is the new comment requirement:
https://confluence.nebula-graph.io/pages/viewpage.action?pageId=35293986
The license check looks fine, it can pass.

@@ -80,7 +80,7 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string&
return future;
}

if (!sessionManager_->isOutOfConnections()) {
if (!sessionManager_->isWithinConnections()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer the previous function name.

Shylock-Hg
Shylock-Hg previously approved these changes Feb 14, 2022
@@ -80,7 +80,7 @@ folly::Future<AuthResponse> GraphService::future_authenticate(const std::string&
return future;
}

if (!sessionManager_->isWithinConnections()) {
if (!sessionManager_->isOutOfConnections()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should keep isOutOfConnections fit its name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yixinglu suggests isOutOfConnections prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this function is obviously conflict with its implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Obviously, it should be:

if (isOutOfConnections) {
//report error
}

@critical27 critical27 merged commit a9c3235 into vesoft-inc:master Feb 14, 2022
liwenhui-soul pushed a commit to liwenhui-soul/nebula that referenced this pull request Feb 15, 2022
* comment GraphSessionManager

* comment ClientSession

* modify_and_comment_session

* comment

* add more comment

* fix comment

* fix comment

* fix comment
@zhaohaifei zhaohaifei deleted the modify_and_comment_session branch April 26, 2022 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants