I am using EventStreams feed /v2/stream/recentchange in DiscordWikiBot with the help of a C# library called EvtSource. Around the end of November 2019 it started to report an exception every 15 minutes (counted from the start of the connection to stream.wikimedia.org) from some unrecognised responses. I haven’t changed anything in the code around that time and nothing was changed in EvtSource either, having used stream.wikimedia.org since July 2019.
I tried to look what might’ve gone wrong, but I couldn’t find it myself, so I thought I could ask the developers what kind of response EventStreams could send every 15 minutes and from which side fixing this should be approached.
Links to code, if they are helpful:
- Library code from which exception is filed: https://github.com/3ventic/EvtSource/blob/master/EvtSource/EventSourceReader.cs
- My code of DiscordWikiBot that uses that library: https://github.com/stjohann/DiscordWikiBot/blob/master/DiscordWikiBot/EventStreams.cs#L88
Console logs from my bot (don’t tell much other than constant timing; 3-4 seconds is, obviously, the amount of time it spends waiting to retry):
[2020-01-14 14:25:23] [EventStreams] [Warning] Stream returned the following exception (retry in 3000): System.IO.IOException: The server returned an invalid or unrecognized response. at System.Net.Http.HttpConnection.FillAsync() at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsyncCore(Memory`1 buffer, CancellationToken cancellationToken) at System.IO.StreamReader.ReadBufferAsync() at System.IO.StreamReader.ReadLineAsyncInternal() at EvtSource.EventSourceReader.ReaderAsync() [2020-01-14 14:40:27] [EventStreams] [Warning] Stream returned the following exception (retry in 3000): System.IO.IOException: The server returned an invalid or unrecognized response. <…> [2020-01-14 14:55:30] [EventStreams] [Warning] Stream returned the following exception (retry in 3000): System.IO.IOException: The server returned an invalid or unrecognized response. <…> [2020-01-14 15:10:34] [EventStreams] [Warning] Stream returned the following exception (retry in 3000): System.IO.IOException: The server returned an invalid or unrecognized response. <…> [2020-01-14 15:25:37] [EventStreams] [Warning] Stream returned the following exception (retry in 3000): System.IO.IOException: The server returned an invalid or unrecognized response. <…>
I was told in IRC that it is OK to ask this over Phabricator.