-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing 100% CPU untilisation when SSL negotiations fail - Maybe related to #225 & #458 #459
Conversation
# Conflicts: # src/main/java/org/java_websocket/server/WebSocketServer.java
Hello @becast, thx for your pull request. Could you explain why you made those changes to the code? I would like to understand the reasoning behind this :) Greetings |
Hi! Yes, if you use the library to create a WSS Server and i.e. test it with the SSL-Labs test (https://www.ssllabs.com/) a lot of connections are made and in some cases aborted. It appears that this leaves some connections in Limbo forcing their way through selector.select(); in WebSocketServer.java These connections are not Handshaking and have the SSLEngine closed but keep the WebSocketSelector busy and causing 100% CPU as the selector tries to read them. This change examines the Connection status upon reading to detect these "Limbo" connections, and since this is a SSL only issue fixing it in the selector seems to be much more work and prone to introduce issues for non WSS connections. That being said, I'm not sure why all my previous PR are here too. It*s only the last one ( 203470b) I wanted to merge. |
Hello @becast, I testet your changes against the autobahn ws testcase and also against https://www.htbridge.com/ssl in production. It fixes the 100% CPU usage. Is it fine for you that I copy the changes over to my repository and also add some comments for a future me to it? (And don't f**k up this repository with all the other changes included in this pull request) Greetings |
Yes that is completely fine! I'm not sure how I screwed up that PR so badly xD |
Fix for TooTallNate#458 (code cleanup of TooTallNate#459)
Thx again for your help! Included with PR #461 Greetings |
No description provided.