You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 theno_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.
The text was updated successfully, but these errors were encountered: