-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`sysread': end of file reached (EOFError) #535
Comments
@spagalloco Any idea why this might be happening? |
It sounds like you are experiencing an occasional disconnect. @sferik, it looks like we need to add reconnection logic into streaming connections. This gets fairly hairy as Twitter requires exponential back-offs, em-twitter's implementation is primarily here: https://github.com/tweetstream/em-twitter/blob/master/lib/em-twitter/connection.rb#L254-L293 I'm happy to help with this. On em-twitter, I tried to start simple, but this quickly grew fairly complicated. @howpeegoo, for now, you could rescue def get_tweet_colors
tries = 5
puts 'starting sample'
count = 0
debug_object = nil
@client.sample do |object|
debug_object = object
puts object.class.to_s
count += 1
puts count
end
puts 'exiting getter loop'
puts debug_object
rescue EOFError =>
if (tries -= 1) > 0
sleep 10
retry
else
raise e
end
end
end |
@stve Any interest in attempting to add reconnection handling for streaming to the |
@sferik definitely, would be a great addition to 6.0.0 |
I'm encountering the error below after typically < 2 hours of run time. I've encountered this with Ruby 1.9.3, and Ruby 2.1.0, installing the twitter gem with "gem install twitter":
/home/pi/.rbenv/versions/2.1.0/lib/ruby/2.1.0/openssl/buffering.rb:129:in 'sysread': end of file reached (EOFError) from /home/pi/.rbenv/versions/2.1.0/lib/ruby/2.1.0/openssl/buffering.rb:129:in 'readpartial' from /home/pi/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/twitter-5.7.1/lib/twitter/streaming/connection.rb:14:in 'stream' from /home/pi/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/twitter-5.7.1/lib/twitter/streaming/client.rb:111:in 'request' from /home/pi/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/twitter-5.7.1/lib/twitter/streaming/client.rb:53:in 'sample' from testtwitter.rb:24:in 'get_tweet_colors' from testtwitter.rb:37:in '<main>'
The error appears to be occurring doing the loading of an object at "@client.sample do |object|". The code I used to generate this error is:
Using a library like TweetStream, I've been able to run without error. Any thoughts why this is breaking?
The text was updated successfully, but these errors were encountered: