Skip to content

WebSocketServer crashes when overridden methods throw Exceptions #1481

@cvilsmeier

Description

@cvilsmeier

Describe the bug
WebSocketServer crashes when overridden methods (onClose, onError) throw Exceptions.
It hit us in production: Due to circumstances, our implementation threw some exceptions in the wrong places for one "bad" websocket client. The exceptions led to the WebSocketServer crash: The server wasn't accepting any more client connections, even from "good" clients.

To Reproduce
Steps to reproduce the behavior: I've prepared a minimal reproducer:

  1. Go to https://gist.github.com/cvilsmeier/de7d1f3419f421de132b1acf16e7b04f
  2. Execute the program

Example application to reproduce the issue
Please see https://gist.github.com/cvilsmeier/de7d1f3419f421de132b1acf16e7b04f

Expected behavior
Maybe more "desirable" would be a WebSocketServer that stays up, no matter which exceptions are thrown in the "onOpen" and "onError" method implementations.

Environment(please complete the following information):

Thank you
for your websocket library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions