danwrong / restler

REST client library for node.js
MIT License
1.99k stars 391 forks source link

No more HTTP requests made to backend after some undetermined condition #102

Open icelava opened 11 years ago

icelava commented 11 years ago

We use Nodejs + Sockjs as a web socket server. It maintains connections with clients, and incoming data requests via web socket get converted to HTTP REST calls to backend servers. Restler is used to make the requests to backend.

var restRequest = restler.get(serviceUrl, requestOptions);
restRequest.on('complete', responseCallback);

In recent weeks, we observed our socket server randomly stop sending HTTP requests to the backend. It still works fine accepting connections from clients and upgrading them to websocket, and responding to any data messages that do not involve backend communication.

The key thing is, observed from Wireshark, no TCP connection is even made out of the network adapter to communicate with the backend.

The only resolution is to restart the node.exe process (this is Windows hosted). This works for a random period of time until the same condition happens again, which we cannot identify the cause since the same pattern of calls are done throughout the day.

This is not necessarily to claim that Restler is the library causing this problem, but as the socket application code works and logs all the way until the Restler call, we are looking for ways to further troubleshoot and investigate this issue to resolve whatever the real cause is.

Would appreciate any advice on how to further go about this. thanks.

icelava commented 11 years ago

It appears to be a 5-socket constraint on Node's globalAgent default setting.

https://groups.google.com/forum/?fromgroups=#!topic/nodejs/Tz5XqFg8UsQ