Extending the timeout
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- express, javascript, node.js
- Domain
- backend
Research direction
Review how the connect-timeout middleware initializes its timeout and how req.clearTimeout() behaves during request processing. Reproduce the described GET request with remote-fetch retries, then determine whether a per-request timeout override is supported or needs a documented design; done means the request can retain a longer timeout without removing timeout handling entirely.
Written by the indexing model from the issue text.
Description
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?
- Dominant language
- JavaScript
- Stars
- 320
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from expressjs/timeout
-
Upgrade Dependencies Open
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in expressjs/timeout
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
antfu-collective/icones#398 ·
-
ECmail.com Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
wesbos/burner-email-providers#554 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
components-web-app/docs#92 ·