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

Console will send query YIELD 1 when type query once. #148

Closed
Shylock-Hg opened this issue Dec 21, 2021 · 7 comments
Closed

Console will send query YIELD 1 when type query once. #148

Shylock-Hg opened this issue Dec 21, 2021 · 7 comments
Labels
affects/none PR/issue: this bug affects none version. process/done Process of bug severity/none Severity of bug type/bug Type: something is unexpected

Comments

@Shylock-Hg
Copy link
Contributor

No description provided.

@Shylock-Hg Shylock-Hg added the type/bug Type: something is unexpected label Dec 21, 2021
@jievince
Copy link
Contributor

Sorry, I don't get it. Could you paste the screenshot here?

@Shylock-Hg
Copy link
Contributor Author

e.g.

E1222 15:08:19.979668 82943 GraphService.cpp:161] Execute query: YIELD 1
E1222 15:08:25.319705 82943 GraphService.cpp:161] Execute query: return 'abc'

I just execute return 'abc', but console send YIELD 1 too.

@jievince
Copy link
Contributor

e.g.

E1222 15:08:19.979668 82943 GraphService.cpp:161] Execute query: YIELD 1
E1222 15:08:25.319705 82943 GraphService.cpp:161] Execute query: return 'abc'

I just execute return 'abc', but console send YIELD 1 too.

When get a new connection, nebula-go will call ping(), which will execute YIELD 1.
See https://github.com/vesoft-inc/nebula-go/blob/40030d441885c03c34054391e841e8f59443e0af/connection_pool.go#L149.
nebula-cpp also did so:
https://github.com/vesoft-inc/nebula-cpp/blob/e34071fe7bfb68e2012c94fcd03be4707216c45a/src/client/ConnectionPool.cpp#L63

bool Connection::isOpen() { return ping(); }


void Connection::close() {
  if (client_ != nullptr) {
    clientLoopThread_->getEventBase()->runImmediatelyOrRunInEventBaseThreadAndWait(
        [this]() { delete client_; });
    client_ = nullptr;
  }
}


bool Connection::ping() {
  auto resp = execute(0 /*Only check connection*/, "YIELD 1");
  if (resp.errorCode == ErrorCode::E_RPC_FAILURE || resp.errorCode == ErrorCode::E_DISCONNECTED) {

@Shylock-Hg Shylock-Hg reopened this Dec 22, 2021
@Shylock-Hg
Copy link
Contributor Author

Shylock-Hg commented Dec 22, 2021

I know ping, But nebula-console will send ping when user send query not just when connecting.

@jievince
Copy link
Contributor

But console just uses the nebula-go's interface session.execute, it doesn't use ping.

@jievince
Copy link
Contributor

Which version of server do you use? I couldn't find this line GraphService.cpp:161] Execute query: in the code.

@Shylock-Hg
Copy link
Contributor Author

Shylock-Hg commented Dec 22, 2021

Which version of server do you use? I couldn't find this line GraphService.cpp:161] Execute query: in the code.

That's code I added to print the query, you could add too.

@jievince jievince closed this as completed Dec 7, 2022
@github-actions github-actions bot added the process/fixed Process of bug label Dec 7, 2022
@HarrisChu HarrisChu added the process/done Process of bug label Dec 7, 2022
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug and removed process/fixed Process of bug labels Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/none PR/issue: this bug affects none version. process/done Process of bug severity/none Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

3 participants