Simple Node program using official library takes long time to terminate

I have a simple program:

elasticsearch = require('elasticsearch');

client = new elasticsearch.Client({
hosts: 'localhost:9200',
log: 'trace'
});

client.ping({
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1fa90d02-bc8b-4f22-98b4-7d0e92dca8b6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.