Skip to content


Subversion checkout URL

You can clone with
Download ZIP


callback isn't called on remote error? #441

zh99998 opened this Issue · 3 comments

1 participant


i have a small server written in nodejs and using request.
it will request several http server periodically then parse and output to client.

in Line 56:

  main = (servers)->
    _.each servers, (server)->
      request {url: server.index + '/?operation=getroomjson', encoding: 'binary'}, (error, response, body)->

this main function will be called every 5 seconds.
this script always goes down after hours or days. one or some http backends are choked, their request callback are not called anymore
i have tried to log before and in callback of request

console.log 'before request:' + server.index + '/?operation=getroomjson'
request {url: server.index + '/?operation=getroomjson', encoding: 'binary'}, (error, response, body)->
  console.log 'request callback:' + server.index + '/?operation=getroomjson'

it shows that request is called, but callback function is not called.

after this problem happened, just restart this script, it will workes again, and after a time it choke up again.

when in choking, access to http backend directly with curl, it works normally.


it happend mostly on bad network
i have many http backend server, and the one with bad network happens frequency.
and in rush hour it happens frequency.


i have added a requsting flag to prevent suspending too much request, and it still choke up


ooh....seems solved by adding a timeout, thanks #442 .
if it continue work in days, i'll close this issue..

@zh99998 zh99998 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.