question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

requestTimeout has no effect (@elastic/elasticsearch v6.8.0),

See original GitHub issue

I am trying to set a relavtively short requestTimout, but it seems that the requestTimeout has no effect at all. Tried setting it to 0ms ans 1ms, but it does not time out, and the requests finishes successfully.

Client is created like this:

const client = new Client({
		node: url,
		requestTimeout: 0
	});

and I do an mget() to fetch multiple documents:


const fetchDocuments = (ids) => {
	const docs = ids.map((id) => {
		return {
			_index: 'my-index',
			_type: '_doc',
			_id: id,
		};
	});
	return client.mget({
		body: { docs }
	});
};

No matter what I set the requestTimeout to, it does not time out. This becomes an issue if elastic is unresponsive, and the requests hang.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
havbercommented, Jul 1, 2019

@delvedor I was able to work around this using Promise.race([...]) (https://italonascimento.github.io/applying-a-timeout-to-your-promises/). I’ll try to se if I can reproduce using es-reproduce-issue, or determine if there is a flaw in my implmentation, when I have the time to look into it.

0reactions
shussoncommented, Nov 6, 2019

I’m also seeing requestTimeout, say 10000, have seemingly no effect with v6.8.3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requesting Elasticsearch from Node times out - Stack Overflow
This fails with a simple error message Errror: Request timeout after 30000ms. Am I missing something here? I've read trough the client docs,...
Read more >
Migrating to 8.0 | Elasticsearch Guide [8.5] | Elastic
This section discusses the changes that you need to be aware of when migrating your application to Elasticsearch 8.0. See also What's new...
Read more >
@elastic/elasticsearch - npm
The official Elasticsearch client for Node.js. Latest version: 8.5.0, last published: 2 months ago. Start using @elastic/elasticsearch in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found