Feature/evict slow clients - #2
Open
jeetvdevvee wants to merge 3 commits into
Open
Conversation
Bumps the go_modules group with 1 update in the / directory: [golang.org/x/net](https://github.com/golang/net). Updates `golang.org/x/net` from 0.0.0-20191116160921-f9c825593386 to 0.55.0 - [Commits](https://github.com/golang/net/commits/v0.55.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.55.0 dependency-type: indirect dependency-group: go_modules ... Signed-off-by: dependabot[bot] <support@github.com>
…evict-slow-clients
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Name
Feature/evict slow clients
Purpose
Forked 'github.com/r3labs/sse/v2' to our repo , so that we can make changes on how SSE connection works.
Summary
Change: Added an EvictSlowClients option (on Server, applied to each Stream at creation) that makes the event fan-out loop non-blocking per subscriber. When a subscriber's buffer is full, it's evicted immediately instead of blocking delivery. Eviction and normal disconnects now share one unsubscribe() path that safely removes the subscriber and fires OnUnsubscribe exactly once.
Purpose: Let one slow or stalled SSE client be dropped instead of stalling the whole stream.
What it solves:
previously, one slow client's full buffer would block the fan-out goroutine, freezing event delivery to every other subscriber on that stream.
Testing Done
Locally tested with different usecases
-> Opening multiple connections to server
-> Turning off/on airplane mode on tablet
-> Tested all functionalities
-> Switching between two different versions of the app
-> Switching networks back and forth
Testing to Do
Need to be tested thoroughly with server changes
Related PRs
Does this PR affect the software document?
Software Document PR:
Does this PR affect the overall design inputs?
Design Inputs PR:
Any other related PRs: