Fix silently swallowed / unpropagated errors in bind, polling disconnect, and websocket writes - #217
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
Fix silently swallowed / unpropagated errors in bind, polling disconnect, and websocket writes#217devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
…socket writes Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Member
|
@devin-ai just adding in ChannelFutureList is no use |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
|
@sanjomo agreed — reverted the If you'd still like WebSocket write failures surfaced on the send promise, I'd rather do it properly (e.g. a |
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.
Description
Review of error handling in the core module surfaced a few places where failures were silently swallowed or not propagated. This tightens those up without changing intended behavior.
Type of Change
Changes Made
SocketIOServer— bind failure cause was dropped. On a failed bind the code logged a generic"Failed to start server on port {}"but discardedfuture.cause(), so the real reason (port in use, permission denied, …) was invisible. Now logsfuture.cause().SocketIOServer— swallowed port-resolution exception. Thecatch (Exception ignore) {}around resolving the actual bound port (used withport=0) is nowcatch (Exception e)with adebuglog so the failure isn't completely invisible.PollingTransport— NPE on disconnect for unknown session. Thedisconnectbranch calledclient.onChannelDisconnect()without a null check, unlikeonGet/onPost/onOptions. A disconnect request for an already-removed session threw an NPE up the pipeline. Now mirrors the sibling handlers: logs and returns an error response when the client is missing.EncoderHandler.readVersion— swallowedIOException. An unreadableMANIFEST.MFwas skipped with an empty catch; now logged atdebug(still non-fatal so other manifests are still scanned).Testing
mvn test(ranEncoderHandlerTest(21),AuthorizeHandlerTest(11),InPacketHandlerTest,PacketListenerTest)mvn checkstyle:check→ 0 violationsmvn -pl netty-socketio-core -am compilesucceedsAdditional Notes
ChannelFutureListso send-promise failures would propagate; reverted per review feedback.Link to Devin session: https://app.devin.ai/sessions/99a4ba93decd4b47be31cb129923fe6e
Requested by: @sanjomo