Giter Club home page Giter Club logo

Comments (8)

eric avatar eric commented on July 28, 2024

Have you looked into why Twitter::JSONStream isn't reconnecting for us? I believe it should be.

from tinder.

noahd1 avatar noahd1 commented on July 28, 2024

By default Twitter::JSONStream has no special behavior around a response with a non-200 status code, but it allows you to specify an on_error callback to handle this case. This commit introduces an error handler which raises an exception in these cases. Removing the raising of the exception may be necessary but also may not be sufficient to allow Twitter::JSONStream to reconnect in those cases. Perhaps @joshwand who wrote that commit may have some further insight.

from tinder.

bryckbost avatar bryckbost commented on July 28, 2024

@noahd1: I think you're on the right track that removing the raise of the exception might allow Twitter::JSONStream to reconnect. Feel free to play around and submit a pull request.

from tinder.

noahd1 avatar noahd1 commented on July 28, 2024

As I suspected, it is necessary to remove that exception, but not entirely sufficient, (at least in cases that I'm seeing). Unfortunately, this is rather difficult to test, as the problems seem to arise after long periods of inactivity. I do see a couple of reconnection attempts, and then I get this stacktrace:

2011-10-09 23:56:43 | FATAL  | CampfireBot::Bot | Unhandled exception while listening to room devops: Could not parse data entirely
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `<<'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `receive_data'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/var/lib/jenkins/campfire-bot/vendor/ruby/1.8/bundler/gems/tinder-e3c8012dc127/lib/tinder/room.rb:151:in `listen'

The error causes the program to exit of course. Any ideas on what this might be?

from tinder.

massive avatar massive commented on July 28, 2024

I'm having the exactly same problem. I can reproduce this 90% of time just by sleeping a certain amount of time (eg. 10 seconds) in my listen callback.

from tinder.

jonathanpenn avatar jonathanpenn commented on July 28, 2024

Yes, I can concur with @massive that some kind of timeout causes the problem for me, too. I found that the effective delay is because I'm using a blocking network connection talking to another service to feed the campfire stream. I switched to using Thread to make it non blocking and it's working fine now, if that helps.

from tinder.

massive avatar massive commented on July 28, 2024

My remedy for this was to execute code via EventMachine. Eg. executing long running shell commands with EM.system fixed the issue.

from tinder.

asheren avatar asheren commented on July 28, 2024

Hi there! We're doing some open source maintenance work and closing old issues. If this issue is still applicable or you would still like it to be addressed, please re-open the issue by April 17, 2017. Thanks!

from tinder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.