Skip to content
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

no_data_callback not being called when newlines (\n\r) are being received #38

Open
mgartner opened this issue Apr 9, 2014 · 1 comment · May be fixed by #39
Open

no_data_callback not being called when newlines (\n\r) are being received #38

mgartner opened this issue Apr 9, 2014 · 1 comment · May be fixed by #39

Comments

@mgartner
Copy link
Contributor

mgartner commented Apr 9, 2014

Twice in the past month I've had my long running Twitter Stream consumer stall and not receive any tweets, without it calling the no_data_callback. I'm wondering if this could be because the Streaming API is sending whitespace (\n or \r or both) and this whitespace is actually treated as data at https://github.com/voloko/twitter-stream/blob/master/lib/twitter/json_stream.rb#L130. This line that resets @last_data_received_at doesn't seem to check whether the data is whitespace or not - and maybe that's why the no_data_callback is never called.

I guess this would be the wrong place to set @last_data_received_at anyway because it can't know that the data is whitespace without first parsing it.

I'm happy to work on a fix, but I wanted to get some feedback first on whether or not my logic seems sound.

@mgartner mgartner linked a pull request Apr 9, 2014 that will close this issue
@mgartner
Copy link
Contributor Author

I thought this was definitely the issue I was having, but after deploying the fix, I experienced the same hang in the stream only a few days later. I don't know what's going on, but it seems like either Twitter is sending gibberish that isn't empty but also isn't parsed; or they are sending nothing or empty data and EventMachine's periodic timer is broken.

It's a mystery how this library has running so well for over 2 years with only a couple of freezes in that time, and now in the last two months I've had 4-5 with no obviously relevant changes to the library or my client code.

Any help in debugging this is greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant