You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of single-threaded nature of NodeJS event loop, even before the HTTP request is triggered to downstream application, NodeJS is self timing out resulting in HTTP request not reaching to downstream application at all. i.e by the time main thread is picking up this task the timeout has already occurred (30ms have already elapsed) & the request to downstream application never got triggered.
Ideally the timer should have started after the request is triggered but in this case it seems like the timer starts immediately which is causing this issue.
Meanwhile, I increased the timeout to 120ms from 30ms, the self-timeouts have reduced from ~2.5K per hour to 2-8 per hour.
letoptions={url: Url,//URL to hitqs: params,//Query string datamethod: "GET",//Specify the methodtimeout: 30};request(options,(error,response,body)=>{if(error){returncallback(newErrorResponse(500,{error: error}));}else{returncallback(null,response,body);}});
The timeout in request is not what you're expecting, it's a connection timeout.
From the docs: timeout - integer containing the number of milliseconds to wait for a server to send response headers (and start the response body) before aborting the request. Note that if the underlying TCP connection cannot be established, the OS-wide TCP connection timeout will overrule the timeout option (the default in Linux can be anywhere from 20-120 seconds).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Because of single-threaded nature of NodeJS event loop, even before the HTTP request is triggered to downstream application, NodeJS is self timing out resulting in HTTP request not reaching to downstream application at all. i.e by the time main thread is picking up this task the timeout has already occurred (30ms have already elapsed) & the request to downstream application never got triggered.
Ideally the timer should have started after the request is triggered but in this case it seems like the timer starts immediately which is causing this issue.
Meanwhile, I increased the timeout to 120ms from 30ms, the self-timeouts have reduced from ~2.5K per hour to 2-8 per hour.
Environment details
node 5.9.1
npm 3.7.x
request ~2.67.0
OS details below
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
Can someone from the authors/contributors look into this ASAP & help me figure out what is the exact issue here.
The text was updated successfully, but these errors were encountered: