cuspymd commented on pull request #4119:
URL: https://github.com/apache/zeppelin/pull/4119#issuecomment-841980605
> The close method of LdapCtx will call the close method of LdapClient to
return the connection to the connection pool. If we rely on the GC mechanism,
although the Context object can be cleared, the connection will not be returned
normally. And a new connection will be created the next time we try to obtain a
connection, which will cause connection leakage.
As bellow code of `LdapCtx::finalize()`, `LdapCtx::close()` called also
when it be released by GC.
```
protected void finalize() {
try {
this.close();
} catch (NamingException var2) {
}
}
```
In both cases, the same function(`LdapCtx::close()`) is called, but I don't
understand that connection leaks occur only when released by the GC.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]