fix(adapter): do not skip local broadcast when publishAndReturnOffset throws#5457
Open
Not-Sarthak wants to merge 1 commit intosocketio:mainfrom
Open
fix(adapter): do not skip local broadcast when publishAndReturnOffset throws#5457Not-Sarthak wants to merge 1 commit intosocketio:mainfrom
Not-Sarthak wants to merge 1 commit intosocketio:mainfrom
Conversation
… throws Remove the `return` in the catch block of ClusterAdapter.broadcast() so that super.broadcast() is still called when remote publishing fails. This ensures local sockets receive the event even if the cluster publish errors out (e.g. due to a serialization error in the adapter layer). Fixes socketio#5456
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.
Summary
Fixes #5456
In
ClusterAdapter.broadcast(), thecatchblock usedreturn debug(...)which preventedsuper.broadcast(packet, opts)from ever being called whenpublishAndReturnOffset()rejected. This meant sockets connected to the same server instance that emitted the event would silently never receive it.The fix removes the
returnkeyword so thatsuper.broadcast()is still called after logging the error — matching the pattern already used inaddSockets,delSockets, anddisconnectSockets.return debug(...)→super.broadcast()skipped → local sockets get nothingdebug(...)→super.broadcast()still runs → local sockets receive the eventTest plan
"broadcasts to local clients even when publishAndReturnOffset throws"engine.iotests pass (189/189)engine.io-clienttests pass (93/93)