-
Notifications
You must be signed in to change notification settings - Fork 255
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
stream stopped after: Operational disconnect #462
Comments
That error message seems to be associated with clients that are consuming the data too slowly: https://developer.twitter.com/en/support/twitter-api/error-troubleshooting#operational-disconnect Out of interest were you looking at anything likely to be especially bursty or high volume? The easier thing to do would be to check for that specific error in the streaming code and reconnect automatically. If it's something that is coming up frequently we might need to look at moving the streaming endpoint processing to it's own background thread, but that's a bit more involved. |
It might have been high volume. It does seem like an easy fix for now would be to log it and reconnect. |
This is explicitly handled in WIP form on #468. One curious thing to me is why we need to handle this case specially - from reading the code I would have thought the request to the API would be closed on the Twitter side or timeout on the client side, which would just lead to an immediate attempt to reconnect... |
An aside, this is an excellent idea for recovering from stream failures: https://twittercommunity.com/t/filtered-stream-request-breaks-in-5-min-intervals/153926/9?u=igorbrigadir
|
I think this would be nice to have (as an option). I think logging the error and reconnecting is a good start. |
I agree, I would have thought the connection drop would have caused twarc to reconnect. But perhaps it is closing in a new way that the decorators don't have covered? At the moment I think twarc2.get is just protected against connection reset and timeout exceptions? Can't the server cleanly close the connection right without causing an exception? I propose we merge the fix for now and add the idea for retrieving lost tweets as an enhancement. |
This fix was released in v2.1.6. |
I was running a
twarc2 stream
for a few days and noticed it terminated with this error message and failed to reconnect:The text was updated successfully, but these errors were encountered: