Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Game sometimes hangs when client attempts to start a match #5

@randomPoison

Description

@randomPoison

After implementing support for discarding tiles was added in 1a1d760, the game has started to hang when entering a match. This doesn't happen every time, but it does seem to happen a majority of the time.

If we exit play mode while the client is in this stuck state, we get an exception indicating that the client is still awaiting the match start response from the server:

TaskCanceledException: A task was canceled.
<...>
WebSocket+<RecvStringAsync>d__2.MoveNext () (at Packages/com.synapse-games.websockets/Runtime/WebSocket.cs:25)
<...>
Synapse.Mahjong.Match.MatchController+<<Init>g__RequestStartMatch|15_0>d.MoveNext () (at Assets/Scripts/Match/MatchController.cs:107)
<...>

Which points back to the await in this code:

// Request that the server start a match.
var request = _client.CreateStartMatchRequest();
_socket.SendString(request);
var responseJson = await _socket.RecvStringAsync(cancellation);

There's very little logging on the server side currently, so it's difficult to tell what's going on, but it seems likely that the server is dead-locking somewhere in the handling logic for the start match response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclientChanges that affect the client codebase

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions