-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
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:
- Go to https://gist.github.com/cvilsmeier/de7d1f3419f421de132b1acf16e7b04f
- 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):
- Version used: Java-WebSocket-1.6.0.jar
- Java version: oracle jdk21
- Operating System and version: Debian Linux 12.11
- Link to your project: https://gist.github.com/cvilsmeier/de7d1f3419f421de132b1acf16e7b04f
Thank you
for your websocket library.