According documentationhttp://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html,
I need to close client on shutdown. What will be if don't do that? May it
cause to memory leak on elasticsearch server side? Say, JVM with my
application just shutdown unexpectedly without closing client. How will it
affect on elasticsearch server that is launched in different JVM?
If client is shutdown unexpectedly, there will be errors in the server log,
something like "connection reset by peer", "closed", "interrupted", "read
error", "broken pipe", whatever. Active operations may complete, but
responses can not be sent back.
If you do not close a transport client, the thread pool and socket
connection pool will stay active and open unless you shut down the whole
JVM.
A node client does not have a thread pool or connection pool, it is tied to
the underlying node, and also in this case, unless you close the node, the
node thread pool and node connection pool will stay open.
Thank you for your reply.
Just to clarify I want to ask again. I'm using transport client on my
client side. It's possible in my case that client JVM can be just turned
off. Elasticsearch server is run on a different machine. Will there be some
issues with elasticsearch (besides errors in logs) if I my client JVM is
disabled by some reason?
Thanks,
Vasiliy
On Tuesday, December 3, 2013 5:55:16 PM UTC+9, Jörg Prante wrote:
If client is shutdown unexpectedly, there will be errors in the server
log, something like "connection reset by peer", "closed", "interrupted",
"read error", "broken pipe", whatever. Active operations may complete, but
responses can not be sent back.
If you do not close a transport client, the thread pool and socket
connection pool will stay active and open unless you shut down the whole
JVM.
A node client does not have a thread pool or connection pool, it is tied
to the underlying node, and also in this case, unless you close the node,
the node thread pool and node connection pool will stay open.
The issues are dropped connections, and maybe lost documents when indexing
is active.
You were asking about memory leaks. This is only one type of bugs. There
have been some Netty 3-related bugs a while ago, the epoll bug for example
(< 3.2.6)
It always depends on the versions, if there are known bugs or not.
I see your point. Thank you for reply. It's better to try to close client
in such a case.
Cheers,
Vasiliy
On Tuesday, December 3, 2013 6:47:24 PM UTC+9, Jörg Prante wrote:
The issues are dropped connections, and maybe lost documents when indexing
is active.
You were asking about memory leaks. This is only one type of bugs. There
have been some Netty 3-related bugs a while ago, the epoll bug for example
(< 3.2.6)
It always depends on the versions, if there are known bugs or not.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.