Skip to content

Infinite loop by WebGateway client logout #125

Description

@SmySmy

Describe the bug
After closing a WebSocket the OpcUa WebServer tries to logout the client.
For this the function WebGateway::Client::logout(...) is called.
This function first checks if the call is made in the correct thread.
The condition for this is "if (!strand_->running_in_this_thread()) {...}".
If this is not true, the function call is passed to the thread via dispatch.

Now on Windows we could observe that this condition very rarely becomes true.
Mostly we see an infinite loop here.

This causes the problem that the clients are never closed and cleaned up.

To Reproduce
Steps to reproduce the behavior:

  1. Create an active connection over the WebGateway with an OpcUa Server. As a client we use the Firefox Browser.
  2. Close the Tab in which the WebSockets runs.
  3. The WebGateway::ClientManager::receiveMessage() receives a message with the type: "CHANNELCLOSE_MESSAGE".
  4. The WebServer now tries to close the client.
  5. The condition in WebGateway::Client::logout is never true.

Expected behavior
The client should really log out and not be stuck in an infinite loop.

Logs
OpcUaServer.log

Environment (please complete the following information):

  • OS: Windows 10
  • OpcUaStack: 4 - Branch: 392_windows_build_not_working (2022-06-27 16:06:13)
  • Boost: 1.79
  • Platform: x86

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions