Project

General

Profile

Actions

Bug #7036

closed

Misleading websocket connect failure message under some conditions

Added by Bruce Toll almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/03/2019
Due date:
% Done:

0%

Estimated time:

Description

With github wt 4.0.5-31-ga05a7c5d, it is possible to receive a misleading websocket connect failure. For instance, if the server is restarted, connected clients will try to re-establish the websocket connections and log an error:

Wt: WebSocket request refused: Origin 'http://localhost:8080' not allowed (trusted origin is 'ws://')

The actual error in this case is that the wtd no longer matches the one expected by the server.

A patch (lightly tested) is attached for your review. The patch logs more information on websocket connection failures. It also kills the failed session more quickly, which is intended to reduce resource consumption.


Files

Actions #1

Updated by Roel Standaert almost 5 years ago

Maybe it should kill the session if it's brand new, but I don't think an origin mismatch in general should ever cause a session to be killed.

Apart from that, the logging could be improved indeed.

Actions #2

Updated by Bruce Toll almost 5 years ago

Thanks for catching the kill issue. I was focused on the server restart situation which results in mismatched session ids and should have limited the kill to that case. I suspect that a mismatched sessionId_ (where logged) implies a new session, but it would be conservative to remove the kill entirely. If you'd like me to update the patch either way, just let me know.

Actions #3

Updated by Roel Standaert almost 5 years ago

  • Status changed from New to Resolved

I decided to handle it in WebController, and not create a WebSession in the first place if it is a WebSocket request coming in.

Actions #4

Updated by Bruce Toll almost 5 years ago

Thanks, Roel. That's a better approach and far more informative message.

Actions #5

Updated by Roel Standaert over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF