mrduncan / ranger

A node.js library for interacting with Campfire. UNMAINTAINED
MIT License
24 stars 12 forks source link

Connection dropping frequently #4

Open sioked opened 12 years ago

sioked commented 12 years ago

I'm not sure if this is an issue with Ranger, but curious if anybody else has seen something similar. I have a chat bot running on heroku with ranger. It works great, but is connected to 2 different chat rooms. Every so often it will drop out of one of the chat rooms. Nothing shows up in the logs, but every once in a while heroku will notice a crash and restart the application. I haven't been able to figure out any reason why this is happening.

Anybody else see this? Anybody running ranger on heroku for extended periods of time?

bryanmikaelian commented 12 years ago

I have been noticing this tool. For my company, our campfire bot appears to be listening to the room still but it is not actually in the room. There is no log of this happening either, like you mentioned. I am at a loss too. The only way for me to resolve it is to actually restart the heroku server.

The time interval for this to occurs seems to be about every hour or so, at least for our implementation.

EDIT:

Digging in to this, it looks like ranger's stteam function talks to to the streaming api for Campfire. This stream function is mainly how room.listen works. 37Signals mentions that clients need to handle timeouts or disconnects from the streaming API. That might be the culprit here.

It also looks like our Ruby allies are running in to this problem (https://github.com/collectiveidea/tinder/issues/27). Apparently Campfire's streaming API will kill idle connections, returning a HTTP 400.

I'm thinking this is the problem here...