Comments (4)
There was a connection leak in version 3.2.0. It has already been fixed in 3.2.1 which was released March 3.
from aerospike-client-java.
I don't think the leak was plugged completely.
In NodeValidator#validateAlias
method a new Connection
is constructed. The Connection
constructor opens up a socket and input output streams:
socket.connect(address, timeoutMillis);
in = socket.getInputStream();
out = socket.getOutputStream();
Those are only closed if the conn.close()
method is invoked. However, if an AerospikeException.Connection
is thrown in the Connection
constructor, the connection will remain open and will leak, because the connection constructor call isn't part of the try
block in the NodeValidator#validateAlias
method:
InetSocketAddress address = new InetSocketAddress(alias.name, alias.port);
Connection conn = new Connection(address, cluster.getConnectionTimeout());
try {
// code omitted for brevity.
}
catch (Exception e) {
// here is where connection is closed, but this won't run if exception happens before try
conn.close();
throw e;
}
Between 3.2.0 and 3.2.1 you did plug the leaks that could have happened with command.authenticate(conn...)
and Info.request(...)
method invocations by wrapping them in the try/catch
block that is omitted in the code snippet above.
However, the leak I am talking about is still a potential problem, if an exception is thrown from the code that runs in the Connection
constructor.
from aerospike-client-java.
Was getInputStream() or getOutputStream() throwing the exception?
This is the only way I can see the socket being connected and then not closed. All other exceptions would mean the socket was never connected, thus does not need to be closed.
Your fix does not address the leak, because conn will still be null in the finally block. The close must be called in the Connection constructor to fix the leak.
from aerospike-client-java.
Yes, so I staged our application with newest client libraries and the memory issue we were seeing and was attributed to aerospike client connection was gone. This means you fixed the memory leak that was hurting memory consumption in our production systems.
To answer your latest question, yes, I did witness an exception in getInputStream
while debugging the memory leak issue locally, having our application (with latest aerospike client libraries) connect to an aerospike server cluster in the cloud (AWS). Now that I think about this case more, I believe it's a far fetched edge case and could only pertain to my local dev system's unique configuration.
You can close this issue and the PR associated with it.
Thank you for your quick responses.
from aerospike-client-java.
Related Issues (20)
- Get namespaces/sets by AerospikeClient.
- Streaming support for batch operations HOT 2
- rename Record to AerospikeRecord HOT 1
- View screenshot link is broken HOT 1
- Type Erasure in 5.1.11 HOT 7
- Fully support surrogates symbol in Strings HOT 5
- Wrong condition for aeropsike client connectivity HOT 6
- Add RetryListener HOT 7
- Security contact? HOT 2
- Aerospike Cluster Peer Invalid Node Docker HOT 3
- Node name is null HOT 1
- Error 20: Partition map empty ( Issue for java client ) HOT 8
- Add support for findBySinceUpdate using since_update in metadata HOT 2
- What is the difference between `BatchRecordArrayListener` and `RecordArrayListener`? HOT 2
- How to make async queries faster? HOT 3
- java.lang.NullPointerException in AerospikeClient.put() HOT 4
- Setters for Spring HOT 2
- Enable releases in github HOT 4
- Problem reading Date type with client version 7.X HOT 2
- When compiling lua, the client discards the exception which has the lua compilation error details. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aerospike-client-java.