Comments (4)
I think I see. If it's "after every event" then that means each connection was initially successful. It does reset the counter in that case - this was intended behavior, because we didn't want intermittent failures to cause increasingly long delays if they only happened once in a while.
I agree that this is still not quite right; if we want to avoid continuing to increase the backoff when things have been working correctly, we should probably have a time threshold, like only reset the counter if the connection has stayed good for X amount of time. Also, I think there is currently a flaw in the logic such that the backoff will not always be incremented even on failed connections. I'll look into this further.
Also, thanks for catching that null issue. I think that in actual use cases that string will not be null (it ultimately comes from StreamReader.ReadLine
which can return a null on end of stream, but I think if the connection is closed we will get an I/O error first) but that's not the kind of thing we should rely on.
from dotnet-eventsource.
Hmm. Are you definitely using the latest release? The problem where MaybeWaitWithBackOff
was being called without an await
was fixed last month in version 3.1.2. You can see the current version of that line here.
from dotnet-eventsource.
For some reason I was using the code from 4da02fb commit, but the problem persists in 3.1.5 too. If the server disconnects after every event, _backOff.GetReconnectAttemptCount() will be always 0 (so actually there will be no delay), which may result in high CPU and network consumption.
I also noticed that if content == null NullReferenceException will be thrown. I'm not sure if it's a normal flow or not, but it looks a bit suspicious.
from dotnet-eventsource.
I believe both the "not increasing the delay after an immediately failed connection" issue and the NullReferenceException have been fixed in the 3.2.0 release.
from dotnet-eventsource.
Related Issues (20)
- SSE Server, Disconnection detection HOT 1
- Release tag missed for 2.2.1 HOT 1
- Null Reference Exceptions in EventSource HOT 8
- Replace System assembly references with framework references HOT 1
- ObjectDisposedException HOT 4
- System.Net.WebException: The operation has timed out. HOT 1
- .NET Standard 1 CVE HOT 7
- Exception when trying to startup LdClient with Event Source HOT 1
- CancellationTokenSource memory leak HOT 7
- close is not closing the stream which is leaving the socket alive HOT 9
- Make the EventSource-class extensible HOT 12
- EventSource doesn't use Proxy configuration HOT 3
- eventsource in blazor HOT 2
- Remove dependency on Polly-Signed HOT 1
- Question: Is there a sample code to know how to use this library? HOT 5
- Retry field not used correctly HOT 5
- Error when importing because of dependencies of LaunchDarkly.Logging HOT 4
- Error when trying to send a request with headers HOT 6
- ASP.NET app needs binding redirect to run HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-eventsource.