http.ClientRequest.setTimeout
does not timeout if dns.lookup exceeds the timeout
#10363
Labels
feature request
Issues that request new features to be added to Node.js.
http
Issues or PRs related to the http subsystem.
This issue arises from a separate issue regarding
dns.lookup
#8436 potentially blocking the libuv threadpool. Right now if you do asetTimeout
on aClientRequest
it does not include the dns resolution in that period. In example if you have areq.setTimeout(100)
and dns resolution takes 5000, it will not timeout. This is explained in the docs becausereq.setTimeout()
is simply a pass-through tosocket.setTimeout()
.That being said, if a user does
http.request().setTimeout(100)
the user-intent in my opinion is that if that request, in it's entirety, is not complete in 100ms, then it should pass a timeout error, irregardless of what part of the dns/tcp/http phase the failure occurs in.Replication gist - https://gist.github.com/owenallenaz/b98ce2b9b491243e76dd517e0fdc46ca
The text was updated successfully, but these errors were encountered: