Site streams - forced disconnects because of duplicate streams


#1

I’m using site streams via Twitter4j. I’ve been experiencing frequent disconnects and reconnects for various reasons. One behavior I’ve identified is that sometimes I will suddenly receive forced disconnect messages for all users on a stream. They are always of the form:

{"disconnect":{"code":2,"stream_name":"MyApp-sitestream123456-FooBar","reason":"duplicate of MyApp-sitestream123456-FooBar"}}

The stream names are always identical, and I’m having trouble understanding what this means.

Some details on the scale: I currently have two application instances running, each responsible for about 1200 users. So each application fills out to one connection with 1000 users and another with a few hundred - when they are allowed to get that far before being disconnected anyway. Most recently it’s been the second connections that get the forced disconnects, while the 1000-user connections are doing fine.

Some of my users tend to have a much higher following than average (some numbering in the tens or hundreds of thousands), in case that matters. I frequently receive the FOLLOWS_OVER_LIMIT warning for them, but that seems unrelated.

What could be the reason for these forced disconnects and how do you recommend I resolve the issue?