Skip to content

Need help. AsyncWampConnection may stuck at InnerSend while WebSocket is already closed? #176

@bigbearzhu

Description

@bigbearzhu

I'm seeing memory leakage with lots of WampMessages stuck on a host Owin WebSocket connection. Could you see if there might be a bug in WampSharp?

I have attached some screenshot for reference.

  1. 2.5GB memory held by AsyncWampConnection.InnerSend
    image

2.WebSocketContext on OwinWebScoketWrapper already has disposed cancellation token and the ClientCloseStatus is 1000 (normal closure).
image

What I have noted is that the public CancellationToken property on OwinWebSocketWrapper is not used anywhere in the code. Not too sure whether that is as designed or not. Another thing is RaiseConnectionClosed is only on WebSocketWrapperConnection.RunAsync when there is any exception caught or a valid cancellation frame is received. Could it miss a scenario that the connection is closed with no cancellation frame right before while (mWebSocket.IsConnected) is called in WebSocketWrapperConnection.RunAsync? Should SendAsync also check if a connection is still alive?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions