# Simple Node program using official library takes long time to terminate

**URL:** <https://discuss.elastic.co/t/simple-node-program-using-official-library-takes-long-time-to-terminate/15440>\
**Category:** Elasticsearch\
**Created:** [January 28, 2014, 2:27am UTC](https://discuss.elastic.co/t/simple-node-program-using-official-library-takes-long-time-to-terminate/15440 "2014-01-28T02:27:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johny\_Lam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johny_lam/32/1487_2.png) [@Johny\_Lam](https://discuss.elastic.co/u/Johny_Lam)\
**Post date:** [January 28, 2014, 2:27am UTC](https://discuss.elastic.co/t/simple-node-program-using-official-library-takes-long-time-to-terminate/15440/1 "2014-01-28T02:27:14Z")

</div>

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](mailto: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](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](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:54am UTC](https://discuss.elastic.co/t/simple-node-program-using-official-library-takes-long-time-to-terminate/15440/2 "2017-07-06T01:54:30Z")

</div>

Closed on July 6, 2017, 1:54am UTC


