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

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

Open
randomPoison opened this issue Apr 21, 2020 · 3 comments
Open

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

randomPoison opened this issue Apr 21, 2020 · 3 comments
Labels
bug Something isn't working client Changes that affect the client codebase

Comments

@randomPoison
Copy link
Owner

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.

@randomPoison randomPoison added the bug Something isn't working label Apr 21, 2020
@randomPoison
Copy link
Owner Author

A good first step would be to get logging in place via the tracing crate. This will allow us to narrow down the source of the problem.

@randomPoison
Copy link
Owner Author

Note that the client will also sometimes get stuck at the very beginning during startup, too. This is more rare, though.

@randomPoison
Copy link
Owner Author

After restarting my client a few times this is no longer happening with as much consistency. I've added server logging so it should be much easier to debug this issue when it happens again, though.

@randomPoison randomPoison added the client Changes that affect the client codebase label May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working client Changes that affect the client codebase
Projects
None yet
Development

No branches or pull requests

1 participant