Simple Node program using official library takes long time to terminate

(Johny Lam) #1

I have a simple program:

elasticsearch = require('elasticsearch');

client = new elasticsearch.Client({
hosts: 'localhost:9200',
log: 'trace'
requestTimeout: 1000,
// undocumented params are appended to the query string
hello: "elasticsearch!"
}, function (error) {
if (error) {
console.error('elasticsearch cluster is down!');
} else {
console.log('All is well');

It's just code taken from the elastic search website. But it takes several
minutes to terminate on its own.

Is there something else I need to include to terminate the program? I've
tried adding client.close() at the end but that doesn't do the trick.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2