Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make timeouts stricter #40

Merged
merged 1 commit into from
May 1, 2020
Merged

fix: make timeouts stricter #40

merged 1 commit into from
May 1, 2020

Conversation

achingbrain
Copy link
Member

Sometimes a request can resolve before the timeout callback fires, this can be because the system is under load and the event loop is blocked.

This change looks at the time taken by a request to resolve when deciding if it's timed out as well as setting a regular js timeout to catch inactive requests.

It also removes the timeout option passed to node-fetch as it implements it's own timeout feature which results in two types of timeout error that can occur - ours and node-fetch's.

@achingbrain achingbrain requested a review from hugomrdias May 1, 2020 07:21
@achingbrain
Copy link
Member Author

Only really useful when you are setting unreasonably short timeouts - in tests for example.

Sometimes a request can resolve before the timeout callback fires,
this can be because the system is under load and the event loop is
blocked.

This change looks at the time taken by a request to resolve when
deciding if it's timed out as well as setting a regular js timeout
to catch inactive requests.

It also removes the `timeout` option passed to `node-fetch` as it
implements it's own timeout feature which results in two types of
timeout error that can occur - ours and `node-fetch`'s.
@achingbrain achingbrain force-pushed the fix/http-timeouts branch from 1ccc921 to 80ad169 Compare May 1, 2020 07:49
@hugomrdias hugomrdias merged commit bbcd1eb into master May 1, 2020
@hugomrdias hugomrdias deleted the fix/http-timeouts branch May 1, 2020 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants