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.

Extending the timeout

See original GitHub issue

So far as I understand it, the timeout value is set when you add the connect-timeout middleware when initializing the express server, so the same timeout applies to every request the comes in thereafter (that matches the route concerned).

What I’m finding is that for some incoming GET requests, there is a particular combination of options in the request that causes a network fetch to a remote resource than is not very reliable. For those requests, I’d like to relax the timeout value for connect-timeout somewhat, to allow for a few fetch retries.

But I can’t see any way to change the timeout value ‘on the fly’, for a particular request. The only control I can see over the timeout is to use req.clearTimeout() whilst processing a request. This is helpful, but timeout is completely removed and will not fire for this request in the future. This is not entirely what I’m looking to achieve… I would like to retain a timeout, but just a slightly longer one.

Is what I’m asking for really naughty, breaking established rules of good practice of which I’m not aware? Or is it a reasonable thing to want to do?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
dougwilsoncommented, Mar 19, 2017

haha, I thought of that solution as well, and oops, forgot to mention it above. Yea, that is a good solution; I’ll definitely work to implement, but not 100% sure if it’ll be today, so please feel free to work on that implementation 😃 AFAIK, req.setTimeout method already exists, so will probably need to refactor some stuff not to shadow that method.

0reactions
JamesMGreenecommented, Mar 9, 2021

See express-timeout-handler alternative implementation with the ability to override the timeout. 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to extend the timeout for services if they fail to start or stop
How to increase the timeout value for the service startup · Launch Windows Registry Editor. · Find the following registry subkey: · Right-click ......
Read more >
Extending the Timeout Processing sample - IBM
This scenario means that you can update or cancel timeout requests processed through one TimeoutControl node by using any of the other TimeoutControl...
Read more >
Increase timeout limit in Google Chrome - Stack Overflow
3 Answers 3 · Chrome: It is not possible to change the timeout settings in Chrome. · Firefox: You can set the value...
Read more >
Extend Timeout - resgate.io
Timeouts are extended in something called a pre-response. The pre-response is sent before the actual response, often as soon as the request has...
Read more >
How do I extend the inactivity timeout for Blackbaud hosted ...
Answer: The inactivity timeout for any Blackbaud hosted user account can be extended to 12 hours. The extended timeout will for cover all...
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