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

server side which missing verifyClientVersion method get too many zombie connections #399

Closed
iiibui opened this issue Dec 15, 2021 · 1 comment · Fixed by #402
Closed

Comments

@iiibui
Copy link

iiibui commented Dec 15, 2021

Invalid connection didn't close immediately when ping failed cause by verifyClientVersion method missing exception(connect to nebula graph < 2.6):

public boolean ping(HostAddress addr) {
try {
Connection connection = new SyncConnection();
if (enabledSsl) {
connection.open(addr, this.timeout, sslParam);
} else {
connection.open(addr, this.timeout);
}
connection.close();
return true;
} catch (IOErrorException | ClientServerIncompatibleException e) {
return false;
}
}

Also see:

public void open(HostAddress address, int timeout)
throws IOErrorException, ClientServerIncompatibleException {
try {
this.serverAddr = address;
this.timeout = timeout <= 0 ? Integer.MAX_VALUE : timeout;
this.transport = new TSocket(
address.getHost(), address.getPort(), this.timeout, this.timeout);
this.transport.open();
this.protocol = new TCompactProtocol(transport);
client = new GraphService.Client(protocol);
// check if client version matches server version
VerifyClientVersionResp resp =
client.verifyClientVersion(new VerifyClientVersionReq());
if (resp.error_code != ErrorCode.SUCCEEDED) {
client.getInputProtocol().getTransport().close();
throw new ClientServerIncompatibleException(new String(resp.getError_msg(),
Charsets.UTF_8));
}
} catch (TException e) {
throw new IOErrorException(IOErrorException.E_UNKNOWN, e.getMessage());
}
}

client.verifyClientVersion will have no response but exception.

@Nicole00
Copy link
Contributor

Great catch, thanks for raising this issue.
#402

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 a pull request may close this issue.

2 participants